-
-
Notifications
You must be signed in to change notification settings - Fork 186
Description
Currently, definitions can be registered to be referenced to in the spec.
The spec allows to register other objects like parameters or responses.
OpenAPI 3: https://swagger.io/specification/#componentsObject
Some of them also exist in OpenAPI 2. Search for "Swagger Object" in https://swagger.io/specification/v2/.
We'd rather get this right with all those objects in mind rather than address them independently each time everyone needs one of them.
It should be easy to create methods to register each object type. Or should we create a single method and pass the type as argument (and deprecate definition)?
Then it's less obvious how to help the developer to use references. Referencing schema definition is automatic. Referencing responses probably wouldn't be, so the user would have to enter the reference response name. Ideally, we'd provide a function that at least takes care of the $ref syntax allowing the user to just enter the name of the ref.