-
Couldn't load subscription status.
- Fork 7.7k
Add raw OpenApi documentation files to rest-api documentation #22940
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
Conversation
0cb8fb8 to
bc3b49e
Compare
|
Thanks, @DAHAG-ArisNourbakhsh, for your pull request. I think the changes you suggested have been replaced by the ones in #20669 by @jsorah. |
|
Could you point me to the url on the keycloak documentation page where either the raw open-api json/yml can be found at? I thought the PR you linked only generated the documentation html. |
|
@abstractj - looks like this PR is taking the intermediate OpenAPI spec generated from the changes I made and making it available from the rest-api documentation page, so I would consider this additive to what I did previously. This seems like a middle ground between not giving devs an easily accessible OpenAPI spec and publishing it on a running KC instance, and instead, just publishing the API spec on the rest-api documentation page for a particular KC release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the below flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.ui.account2.WelcomeScreenTest#accountSecurityTestKeycloak CI - Account Console IT (firefox) org.keycloak.testsuite.model.ConcurrentHashMapStorageTest#testStorageSeparationKeycloak CI - Store Model Tests |
bc3b49e to
caf1bb5
Compare
6b1d7f4 to
8a4539a
Compare
|
What would be the way to generate the openapi.json with the proposed changes? I cant seem to find it anywhere after running |
They were already generated even without this PR. This just copies them so the exported documentation also contains them From a blank checkout of keycloak: and then they can be found under |
Closes keycloak#21559 Signed-off-by: Aris Nourbakhsh <[email protected]>
|
@abstractj @jsorah @DAHAG-ArisNourbakhsh |
As far as I'm concerned, only rebasing. |
|
I had a look, and I see at least two levels of problems:
A more general question:
Looping in @999eagle as I know you have been working with the OpenAPI specs. I'd be happy if you could comment on how usable the currently generated OpenAPI documentation is. |
The passthrough syntax was the only way I understood on how to get the html anchor tags into the final document.
My opinion on this: There are most likely still a lot of problems with the OpenAPI definition that go beyond warnings that can only be found when using it in real world scenarios. For example wrong status codes that the static validation can't pickup (dahag-ag/keycloak-openapi#8) (POST /admin/realms to be precise. Should be a 201/20X but says it's a 200) This status code is also completely wrong in the html APIDocs as they are based on the faulty OpenAPI specs. So I'd argue that if the keycloak teams feels comfortable to release the docs in this state then it should not be a problem to also host the faulty spec files. And in the end this will only help to get more eyes on them and find all the issues EDIT: Also some warnings are because the keycloak API in general is implemented "wrong". For example delete operations with bodies are considered against HTTP spec by some generators |
8a4539a to
c416182
Compare
|
I'm still finding (and trying to fix) more discrepancies between the OpenAPI spec and the actual API. I'm fairly certain most endpoints are documented now, but a lot of endpoints are still missing annotations in the source code to document the possible API responses. |
|
IMO, it should be a preview feature. This is because there are warnings by following the OpenAPI notation and some deviations from the implementation. |
|
I am also using the openapi spec in my project. I had to manually fix a few things:
There are probably more problems. I only changed the endpoints i am actually using. |
|
Thank you for all the feedback. I'll look into how to change this PR's content so that it shows this as a preview. While I'm doing it, please submit PRs to update the OpenAPI spec generation. As usual, small issues and PRs that focus on one topic at a time are preferred. If you want to work in pairs on this and have a community member review it, it might free up maintainer's time to work on other things / might get you ahead in the queue. To coordinate, there is already discussion here, so you can drop a note once you have a PR and are looking for another community member: #8898 Be aware that there is a discussion about a v2 Admin API. But as that is not around the corner, we would all benefit from improving the existing documentation in the time being: #8983 |
Signed-off-by: Alexander Schwartz <[email protected]>
|
@ahus1 LGTM |
|
@mhajas - could you please review approve and merge this PR that has been reviewed by the community? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @DAHAG-ArisNourbakhsh and @ahus1
…ak#22940) Add raw OpenApi documentation files to rest-api documentation Closes keycloak#21559 Signed-off-by: Aris Nourbakhsh <[email protected]> Signed-off-by: Alexander Schwartz <[email protected]> Co-authored-by: Alexander Schwartz <[email protected]> Signed-off-by: ShefeeqPM <[email protected]>
Closes #21559