-
Notifications
You must be signed in to change notification settings - Fork 883
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
api/swagger - set type & additionalProperties #12981
base: master
Are you sure you want to change the base?
Conversation
RRSet.changetype is not required as it is empty when listing
@kpfleming could we get your eyes on this? :) |
I'd say testing definitely applies. Did you test or validate this in any way? :) |
I validated the description document. |
This looks reasonable to me, with the caveat that setting |
@Habbie has noted that |
It helps making sure the description document matches the protocol implmenented when clients bail out for unknown properties.
Yes. |
The goal of the document is describe the API and to allow validation tools to confirm that requests and responses are compliant. If the field is required in a request, then the only way for a tool to validate the request is for the document to indicate that it is required. An error from the API endpoint indicating that a required property was not supplied is certainly welcome, but if it conflicts with the description document then it will potentially be confusing to developers using the API. |
I agree with the intention of best-possible-validation and would propose something along … Item:
type: object
additionalProperties: False
required: [ data ]
properties:
data:
type: string
ItemCreate:
type: object
additionalProperties: False
required: [ data, createonly ]
properties:
createonly:
type: string
allOf:
- $ref: "#/components/schemas/Item" but as the entity in question is embedded in Zone for As for parameters, the use of |
Ugh... the inclusion into Zone does make this more complicated. I think the idea of making |
Using swagger nullable ain't easy as well … I'd go to v3.1. |
Unfortunately doing that will require making changes to the API itself, as the current schema is not even fully 2.0 compliant, and will definitely not be 3.x compliant. |
I don't think we want to emit additional json properties in RRsets, just to make the doc/validation tools happy. For large zones, the response size is already a problem. Maybe an ResponseRRSet object is a better idea. |
This would include ResponseZone as well as it embeds ResponseRRSet. Not "required" is still an option - it will fix the dd to match the current implementation. |
A zone response is already different from a zone in a request, so that would only make sense. |
Is there any documentation on the difference so I can have a look and adjust accordingly? |
Short description
This PR addresses missing type fields in the swagger description document.
Additionally RRSet.changetype is not to be "required" as it is empty when listing.
Checklist
I have:
The [-] checks do not apply.