Closed n3wscott closed 6 years ago
Hey n3wscott!
Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.
@rhodie27 Yes, there is an open bug with swagger editor not pulling in parameters from components correctly. https://github.com/swagger-api/swagger-ui/issues/3976 https://github.com/swagger-api/swagger-ui/issues/3558
But I think what is in this PR is correct based on the Open API spec. The swagger UI works correctly.
I will double check the spec... I think I am correct and the tools have not caught up to the new stuff in 3.0.0. https://swagger.io/docs/specification/components/
Here are some random nit-picking comments.
@fmui
In the spec we several places with wording like this: "MUST be a non-empty string". "minLength: 1" should cover this.
I would vote for no validation in the first version of the swagger spec. It might be useful to not have the validation in to allow folks to poke at bad brokers. If we still want validation, could it be a followup exercise?
The schema of the status code '409' of 'PUT /v2/service_instances/{instance_id}' could be an Error, not an Object.
The spec says MAY for an error and expected to be {}
:
| 409 Conflict | MUST be returned if a Service Instance with the same id already exists but with different attributes. The expected response body is `{}`, though the description field MAY be used to return a user-facing error message, as described in [Service Broker Errors](#service-broker-errors).|
The conventions for service and plan metadata are not in the spec, but we link to them from the spec. Should we do something similar here?
I opted to only use the spec.
I have updated based on feedback, adding the missing return types and enums, but I am hesitating to add more validation to the doc just because it is hard to know when to stop. I think it could be a valuable addition to the Open API document, but it is still possible to do as a followup and we could do it one resources
So, what's the meaning of this excerpt:
| 409 Conflict | MUST be returned if a Service Instance with the same id already exists but with different attributes. The expected response body is
{}
, though the description field MAY be used to return a user-facing error message, as described in Service Broker Errors.|
@fmui it means that 409 must at least return {}
and optionally return a service broker error.
@avade thanks for the review! I will fix those missing return params up when I next get a chance.
Would it make sense to put a link to the rendered swagger on the repo README so that it is easily accessible by people?
Would it make sense to put a link to the rendered swagger on the repo README so that it is easily accessible by people?
Sounds like a good follow-up. Maybe even a symlink to a git tag when next release happens.
I'm new to OAPI but is there a way in the "Example Value" that it generates to have it do something like add a "?" when a field is optional? Showing that example is really helpful, but I'm missing the required/optional aspect of each field.
@maximilien ^^
is there a way in the "Example Value" that it generates to have it do something like add a "?" when a field is optional
@duglin This is a quirk of the default swagger ui, click the tab next to "example value" called "Model" and you will see the object in table format with the required fields with descriptions if the model has them.
Ah, I didn't realize the "Model" thing was a link - nice
@n3wscott did you want to fix the two spots @mattmcneeney commented on?
did you want to fix the two spots @mattmcneeney commented on?
@duglin the error pr is not in yet I think
Sorry, not sure what you mean by "error pr"
Matt are your issues resolved? github shows you're still requesting changes
Yes - but if we can get #409 merged then it'd be awesome to update the OpenAPI doc with that change before merging it in (as it makes many of the errors much simpler)
@n3wscott I think there are a few edits that people want to see before we merge this - any chance of getting those in?
Relates to https://github.com/openservicebrokerapi/servicebroker/issues/160
Ready.