-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Default values not present when using UseAllOfToExtendReferenceSchemas #1850
Comments
Hi @mikebeaton. Thanks for all the work you're putting into this - it's much appreciated, and apologies for my lack of responsiveness in getting back to you. Unfortunately, I can only feasibly give so many hours to this project. But this is an area that needs to be addressed, so if you bare with me I will get back to you as quickly as I can. For this particular issue, i.e. not setting defaults in the context of To help me with this, perhaps you could post a code sample that repro's the issue? |
OK I see where the bug is occurring now. In reality, the |
That makes sense, I'll update my suggested code for this issue with that change. In terms of So instead of requiring
I'm not sure if that's anything like what you were thinking of, or sounds like it makes any sense? |
I've made the change you suggested to OAI/OpenAPI-Specification#1851, but it required a supporting change that I think you may not have been expecting (at least, I wasn't, until I did it - though I should have been). The contents of For now, I've made this change in PR OAI/OpenAPI-Specification#1851 (for this issue) and merged it into PR OAI/OpenAPI-Specification#1852 (both issues merged) as well. If you look at the new merge commit d88ef1d from the merged PR, you'll see the minimal changes you are probably expecting - which are all that is needed there, because the code for passing |
Apologies, the Appveyor build has broken. It looks as if my new changes are breaking some of the new tests when merged with the latest version - I'll have to look at this tomorrow. EDIT: The current master build @ 12c4d25 is already breaking, the changes I've made aren't adding any new breaks. |
Fixed by #1852 |
Background: I'm raising these issues because I need to be able to use string enums in a live project's API, with enum name conversion (specifically, camel casing) and with parameter defaults.
I've been running my own, patched versions of the code - first v4, now v5 - to do this successfully, but I'd love to be able to offer this back and have it merged ... if possible!
UseInlineDefinitionsForEnums
UseInlineDefinitionsForEnums
is required in the above solution because defaults aren't legal in OpenAPI when using $ref (e.g. here and here), but it occurred to me that (I think...?!) defaults would be legal in the structure produced when usingUseAllOfToExtendReferenceSchemas
. However they aren't currently supported there: they remainnull
. I think implementing this is do-able, also in a lightweight manner, and compatible with Unification of Overlays and Traits OAI/Overlay-Specification#39I'd like to finish that and offer it in another PR so you can see what I'm talking about! If it works (and if you agree that it's acceptably non-invasive, and also legal according to the relevant standards) then it would be a different solution to allowing string enum defaults, using
UseAllOfToExtendReferenceSchemas
instead ofUseInlineDefinitionsForEnums
. It would need to be combined with OAI/Overlay-Specification#39 to be a fully working solution (i.e. to also respect name conversions), in which case there would be two fully working, valid solutions to the above problem, available to anyone needing them - which I think would be good!The text was updated successfully, but these errors were encountered: