-
-
Notifications
You must be signed in to change notification settings - Fork 653
Generated OpenAPI spec gives $schema errors in the Swagger Editor #252
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
Comments
I went ahead and tried to find the issue and found this schema for event https://github.com/ActivityWatch/aw-server/blob/master/aw_server/rest.py#L57 Seems to be correct, so I also tested the swagger editor which you used. Apparently it for some reason adds this $schema property when converting from JSON to YAML, so it seems like this is simply an issue with the swagger editor actually. If you simply remove that added property it no longer complains. |
I think it's here : https://github.com/ActivityWatch/aw-core/blob/c33ea2e9ad56009fc46d44d731b6643eefe01ddf/aw_core/schemas/event.json |
Oh, you are correct, just got confused when it was reordered.
That's not related to this issue, shouldn't impact.
Good catch. I still don't understand why Swagger editor is complaining though, it is a valid property as far as I understand. https://json-schema.org/latest/json-schema-core.html#rfc.section.7 |
It's valid for a json-schema, not valid for swagger generator: https://swagger.io/docs/specification/data-models/keywords/ #Unsupported Keywords |
@OlivierMary But in that case, why does it give an error about it and not just simply ignore it? |
This is related to the new OpenAPI v3 spec that isn't supported by flask-restplus yet, see: noirbizarre/flask-restplus#518 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still waiting for OpenAPI v3 support in flask-restplus |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi,
Somes returns on
http://localhost:5600/api/swagger.json
swagger.json isn't valid -> put it in
https://editor.swagger.io/
to see error:Maybe set an abstract type for
event.data
or a type including all possibles fields?in any case thanks for the swagger 👍
The text was updated successfully, but these errors were encountered: