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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: Added v22 to Makefile
feat: Adapted sections for newer versions of generator
MarcoMuellner committed Jul 13, 2023
commit 120e255f0ab2e51d4d7a8a39215948758310af4c
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ keycloak/21.0.2.json \
keycloak/21.1.0.json \
keycloak/21.1.1.json \
keycloak/21.1.2.json \
keycloak/22.0.0.json \
keycloak/sso-6.json \
keycloak/sso-7.3.json \

@@ -44,6 +45,7 @@ keycloak/21.0.2.yml \
keycloak/21.1.0.yml \
keycloak/21.1.1.yml \
keycloak/21.1.2.yml \
keycloak/22.0.0.yml \
keycloak/sso-6.yml \
keycloak/sso-7.3.yml \

@@ -60,6 +62,7 @@ keycloak/21.0.2.html \
keycloak/21.1.0.html \
keycloak/21.1.1.html \
keycloak/21.1.2.html \
keycloak/22.0.0.html \
keycloak/sso-6.html \
keycloak/sso-7.3.html \

11 changes: 9 additions & 2 deletions keycloak-openapi-transformer/src/components/schemas.rs
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ use scraper::Selector;

lazy_static! {
static ref SCHEMAS_SELECTOR: Selector =
Selector::parse("#models + .sectionbody > .sect2").unwrap();
static ref SCHEMAS_SELECTOR_DEPRECATED: Selector =
Selector::parse("#_definitions + .sectionbody > .sect2").unwrap();
static ref TITLE_SELECTOR: Selector = Selector::parse("h3").unwrap();
static ref ROW_SELECTOR: Selector = Selector::parse("table > tbody > tr").unwrap();
@@ -16,8 +18,13 @@ lazy_static! {
pub fn parse_schemas(
document: &scraper::html::Html,
) -> IndexMap<String, openapiv3::ReferenceOr<Schema>> {
document
.select(&SCHEMAS_SELECTOR)
let mut tag_sections = document.select(&SCHEMAS_SELECTOR).peekable();

if tag_sections.peek().is_none() {
tag_sections = document.select(&SCHEMAS_SELECTOR_DEPRECATED).peekable();
}

tag_sections
.map(|section| {
(
section
6,296 changes: 6,296 additions & 0 deletions keycloak/22.0.0.json

Large diffs are not rendered by default.

6,296 changes: 6,296 additions & 0 deletions keycloak/22.0.0.yml

Large diffs are not rendered by default.