-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
added schema for all parameters #654
Conversation
This addresses #412, #437, #69, #401, #179 (by inclusion of the For issue #222, we can also add a format for For issue #300, since schemas can be reused, this should address that as well. This solves #595 if we can define the serialization strategy |
<a name="parameterUniqueItems"></a>uniqueItems | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor49. | ||
<a name="parameterEnum"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76. | ||
<a name="parameterMultipleOf"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14. | ||
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter. |
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.
Allow a reference object (i.e. a reference to a schema object) here too?
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.
@ePaul - The Schema Object
allows a $ref
as its value, so there's no need to be explicit about it. It's the same as how body
parameters behave today.
need to reconsider this when looking at 6570 support |
@OAI/tdc please post other comments here--i will not merge until a serialization strategy is provided and there is more time for feedback |
This does not solve #69 nor #401. To me the serialization strategy can be controlled by a To me, the main issue is arrays and the existing I do not advocate using complex models for query/path/header parameters (body and form are okay) - but in favor of simplicity I 👍 the concept. Just need to work through the open questions. |
|
Is there any rough implementation? I'm looking for a simple query parameter of type object serialized into a JSON string. |
@Vanuan I'm not aware of any. We are currently working on the next version of the specification (3.0), and only if that it out, the tools can reliably be updated to support it. (I guess some tools will start implementation earlier, though.) |
Is there some criteria or time frame for 3.0 to be released?
Or you could say that you target supporting specific features, like an ability to specify fields like this: Is GitHub issues is the only place or is there some highlevel roadmap with milestone? |
@Vanuan we're aiming for a summer release for 3.0. The changes are done via specific feature requests and not aiming to support specific APIs. Github issues is the place. It means that not all APIs could be described with OpenAPI. Whether applications change their APIs or don't use OpenAPI is their call. |
This is NOT a complete change, but conceptually it loosens the requirement that all parameters except
body
parameters be of a simple type. Instead, a schema can be provided for all parameter types.For parameter types of type
body
, the schema will be serialized by theconsumes
attribute. For all other parameter types, a serialization strategy needs to be defined (and is still TBD for definition).This serialization strategy would be responsible for turning a complex object into JSON, for example.