-
Notifications
You must be signed in to change notification settings - Fork 56
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
add S.raw #55
Comments
We currently use fastify with fluent schema which works well, but we've hit a snag with the openapi spec that we try to generate from the json schema, when it comes to null values. If we want to return say a string or null, we have to do something along the lines of
This is unfortunately invalid. Instead, we should be setting the type to string, with the nullable option to true (see https://swagger.io/docs/specification/data-models/data-types/). My understanding is that this is a clash between the JSON schema specification and the openapi specification. Do you think using |
Rather than use
But then if you are using As you said, currently, there are discrepancies between Swagger and JSON Schema draft 7. I'm interested in your use cases. I would like to write in fluent-schema and having my endpoints documented with Swagger UI. Is that your goal? |
According to the AJV docs they should have support for Yes, I have the same goal as you. |
* S.raw draft #55 * Add node 12.x * Switch default to node 12.14 * Fix types * turn on noEmit again * fix typo * Uptated to the latest version of AJV and added AJV custom keywords package * Added .raw method on each Schema * Cleanup and doc * Fix coverage and update doc * Add more tests about S.raw * Extracted Raw as a Schema * Add an integration test for AJV and $data * Add a check that the Fragment is an object
馃殌 Allow injecting a raw JSON directly in fluent-schema
Motivation
A few users asked:
ref. #51 #16 #47
Examples
In order to implement that we need to implement a parser to build the fluent-schema internal data structure based on the raw JSON.
https://github.com/fastify/fluent-schema/blob/master/src/ObjectSchema.js#L13
The text was updated successfully, but these errors were encountered: