-
Notifications
You must be signed in to change notification settings - Fork 8
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
$ref
with type: null
not properly converted
#23
Comments
This can probably be resolved, but it is more complicated than your example. For example, the
or a schema which uses more layers of indirection, any of which may use which or If the scenarios simplify down to a schema with To be fully robust, an updated should probably handle An alternate way to code an optionally
which this tool does recognize. Admittedly, that is often harder to put into the schema definitions due to other uses. For multiple reasons (code gen etc.) I've avoided using Thanks for the report, @mattoni |
Thanks for the detailed response! The challenge for me is supporting $refs that can be null, but as a rule of thumb i never make the root component/$ref itself nullable. Obviously there are a lot of possibilities and challenges, but even the simple solution for anyof/oneof would be very beneficial, since i think that's probably a somewhat common scenario. For reference, my 3.1.0 updated spec can be found here: https://github.com/cycleplatform/api-spec/blob/main/platform/api.yml. It's a very beefy API so might have several interesting things in it, but I'm primarily concerned with removing the type: null and adding nullable to make my spec usable again. Is this something that you're planning to tackle, or looking for a contributor? Unfortunately my time is pretty restricted right now, otherwise I would have just dove in. |
@DavidBiesack I ended up finding time to work on this, let me know if that covers most/all of your concerns. At the very least should give a decent enough point to leap from! |
Thanks for your work on this project!
I've got a rather complex spec I recently updated to 3.1.0, but need 3.0.3 for some tooling still. I have many places where in order to support a
$ref
that can benull
in 3.1.0, I do this:However, it is not properly converted (even with
--allOf
), but instead preserved:I'd expect to see something like
Is this something that can be resolved?
The text was updated successfully, but these errors were encountered: