Skip to content
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

Openapi fixes/enhancements #2102

Merged
merged 6 commits into from
Aug 1, 2023
Merged

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Jul 14, 2023

Found by spectral, for all the rules see:
https://docs.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules

It also looks like our API is not OpenAPI3 complaint as we output the type int instead of integer. This should be a bug with how we generate the docs.

I think reviewing should be done by checking which commits to cherry-pick.

@vmcj vmcj requested a review from nickygerritsen July 15, 2023 10:57
servers:
- url: "%domjudge.baseurl%api"
description: API used at this contest
- url: https://domjudge.org/demoweb/api
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs www. in front of it

@@ -1,9 +1,43 @@
nelmio_api_doc:
documentation:
tags:
- name: "Access"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The " are not needed here.

@@ -1,9 +1,43 @@
nelmio_api_doc:
documentation:
tags:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better/cool if we can write some event listener or compiler pass to add this based on the actual tags in all files so we don't repeat ourself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It might be nice if this just comes with NelmioDoc. I've checked and this is actually only optional so I think we can take this out for now.

vmcj added 6 commits July 22, 2023 20:57
This endpoint is optional, but it makes sense to link so people can
build a tool against the stable version (their instance) and the new API
on demoweb.
There is the risk that people will now ask help about an instance in the
wild but I suspect API users will be aware how this works.
Even the original commit seemed to not link to this.
It was recommended by Spectral and makes sense to expose this
information also to systems interacting via the API.
@vmcj vmcj force-pushed the openapi_fixes_enhancements branch from 36ef202 to 24793be Compare July 22, 2023 18:57
@vmcj vmcj merged commit 60e8fd7 into DOMjudge:main Aug 1, 2023
17 checks passed
@vmcj vmcj deleted the openapi_fixes_enhancements branch August 1, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants