-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Fallback to reference description for responses #826
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I don't know the code base so I can't approve myself.
Does it solve your bug @melroy89? |
This comment was marked as outdated.
This comment was marked as outdated.
First of all, @jean-michelet, thank you for the review! 🚀 Secondly and equally thankful to @melroy89 for the detailed reproduction description 💪🏼 From what I can see from your code, the only reason why this wouldn't work is due to the trailing |
This comment was marked as outdated.
This comment was marked as outdated.
@melroy89 - That's exactly what I meant in my reply, we need to consider those use cases because your reference is 100% correct 😅 The code I pushed in the PR didn't take that into account yet, but just pushed a change that does! I never meant that you should remove |
Seems like the second use case you mentioned on your At the moment, seems like cc @asc11cat @Eomm @ivan-tymoshenko, tagging you folks for visibility since you were discussing on the other PR 😄 |
Let me test it again.. |
Yup works now! Thank you so much! I was looking for this for years. @Nelspike I would like thank you by providing a donation! Any payment method will do. |
@melroy89 - Thank you for your generosity and recognition! I'm totally okay doing this without a donation whatsoever, happy to help wherever I can 🎉 |
OK, if you change your mind. Let me know. |
Now hopefully this PR gets merged somewhere before 2030 :) |
I don't think this type of comment is going to help us move any faster. If @climba03003 is ok with the code, I will merge it. |
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
No one can take a joke anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Haha don't worry @melroy89, I assure you we'll get this done this year :)
I just need another member (@climba03003 would be golden) to review
README.md
Outdated
@@ -468,6 +468,9 @@ fastify.get('/responseDescription', { | |||
} | |||
}, () => {}) | |||
``` | |||
|
|||
Additionally, if you provide a `$ref` in your response schema but no description, the reference's description will be used as a fallback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please state the $ref
currently only support the format of matching $id
.
It cannot lookup the fragment part. For example, schemaId#/definitions/subSchema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one, would pointing to the PR that's currently in the works (#676) suffice? 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in a82f2a7, @climba03003 - Feel free to take another look!
Co-authored-by: KaKa <23028015+climba03003@users.noreply.github.com> Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I can release tonight, if anyone's free, feel free to merge and release
Release tonight plz @gurgunday! |
Checklist
npm run test
andnpm run benchmark
and the Code of conduct
This PR attempts to resolve the issue on #795 by resolving the
$ref
given in the schema and fetching that description in case there's none. PTAL! 🚀