-
Notifications
You must be signed in to change notification settings - Fork 74
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
Pet Store is serving up teapots #1
Comments
@philsturgeon the I'd like to add schema -> example generation code, but it's never going to be anywhere near as good as a real example. Even the popular It might be helpful if you could provide examples of what sort of response you would expect from the linked petstore spec. |
Ah of course, my mistake. I'm so used to tools like ReDoc just shoving "string" in for strings, etc, that I'm used to everything working. I was just trying to get a hello-world done with a URL using any schema from anywhere. Using one that's been resolved through Speccy (oas-kit under the hood) I get this:
Attempting to use a sample file from a friend which does have examples, I'm getting this:
It's a valid file according to Swagger Editor. Got any sample files around I can use which will work? I want to verify the functionality so I can merge your openapi.tools PR. |
These look like bugs in the underlying parser library. For now I have opened:
I'll swing back and provide an example as I have time later. May also try to tackle some of the issues above when I get some time, too. I think the discriminator one is an easy fix. |
Thank you. I've merged it up onto openapi.tools now outta trust. :) |
Arg, not much movement on Kin - are there any other libs you could use @danielgtaylor ? Unfortunately I'm not a Go hacker.. |
@johnrhunt @danielgtaylor I just ran into this same issue and came across this blog post. This would seem to be a point of difference between the Swagger specification and OpenAPI 3.0. While arbitrary strings for the reference object are valid Swagger, they do not seem to be so under OpenAPI 3.0, which places them clearly under components/schemas - hence the error (earlier versions of the Pet Store API placed these under 'definitions', rather than components/schemas, and no longer work, either). I would suggest given OpenAPI 3.0's view on this topic, this should not be considered a bug outright, but some additional guidance to assist people with migration would be helpful, too. |
@pmundt I see your point however all resolvers I came across generate such arbitrary references: If someone knows such a resolver, please let us know. |
Hey Daniel! Trying out this awesome thing and getting teapot responses instead of valid mocks:
Responses:
Any ideas? The
--json
switch setsAccept: application/json
which I assume is how you determine the responses. Had the same problem in Postman.The text was updated successfully, but these errors were encountered: