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

Added v22 of keycloak to openapi.jsons, adapted to newer doc versions #34

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MarcoMuellner
Copy link

  • Paths now have a deprecated option
  • Components have a deprecated option
  • Added v22

feat: Adapted sections for newer versions of generator
@MarcoMuellner
Copy link
Author

Hopefully PRs are okay to this repo. I wasn't quite sure how to deal with the new structure of the doc, to keep the old versions running. This way we should be able to keep both running.

Comment on lines +12 to +15
static ref TAG_SECTION_SELECTOR_DEPRECATED: Selector =
Selector::parse("#_paths + .sectionbody > .sect2").unwrap();
static ref TAG_SECTION_SELECTOR: Selector =
Selector::parse("#_resources + .sectionbody > .sect2").unwrap();
Copy link
Owner

Choose a reason for hiding this comment

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

As this is CSS selectors, can we combine them with a comma?

"#_paths + .sectionbody > .sect2, #_resources + .sectionbody > .sect2"


Thank you catching this issue and figuring out the solution. I wasn't even aware Keycloak 22.0.0 had released 😅

Copy link
Author

Choose a reason for hiding this comment

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

Can do :)

@ccouzens
Copy link
Owner

ccouzens commented Jul 13, 2023

It looks like response bodies have become unlinked from requests.

For example, if I search the documentation for AuthenticatorConfigRepresentation I see it linked to GET /admin/realms/{realm}/authentication/config/{id}. But I don't see that link in the JSON.

How keen are you to get it working with the new HTML changes?

Otherwise I can look into it when I have time.

Thank you for contributing :)

@MarcoMuellner
Copy link
Author

I would really love to have an openapi.json from the newest doc. It would help me massively.

The resulting openapi.json is also pretty weird, this is correct. If you can point me into the correct direction, i'd totally try my hands on it, and see if i can fix it somehow, but my rust is pretty bad.

@ccouzens
Copy link
Owner

ccouzens commented Jul 13, 2023

Some other selectors I'm finding useful whilst looking at this:

The path parameters within a section

h6[id^=_path_parameters] + table > tbody > tr

The body parameters within a section

h6[id^=_body_parameter] + table > tbody > tr

This is quite an annoying change, as these HTML tables are quite different in versions <= 21 and version 22.


I think the HTML has changed enough, that we should stop generating versions 21 and below. Keep the JSON committed, but don't have the makefile rebuild them.

The generator can then focus on 22's HTML and not have to worry about compatibility with old versions.

@MarcoMuellner
Copy link
Author

I'd be good with that :)

@ccouzens
Copy link
Owner

Hey,

Can you let me know what you think of this?

https://raw.githubusercontent.com/ccouzens/keycloak-openapi/version-22/keycloak/22.0.0.json

@MarcoMuellner
Copy link
Author

I'd need to do some more in depth testing of it with an existing keycloak instance, but this looks good to me :)

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.

None yet

2 participants