Skip to content

JSON schema: move the element id mapping to docs.yaml and drop the legacy "id" keyword - #3603

Merged
christiangoerdes merged 1 commit into
masterfrom
fix/schema-remove-legacy-id
Oct 27, 2026
Merged

christiangoerdes merged 1 commit into
masterfrom
fix/schema-remove-legacy-id

Conversation

@christiangoerdes

@christiangoerdes christiangoerdes commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Documentation
    • Generated YAML documentation now uses format version 2 and includes entries for elements without documentation.
    • Each documented element now includes a reference to its JSON Schema definition.
  • Bug Fixes
    • Generated JSON Schemas no longer include element IDs as schema tags.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8463cb9 and 41cc5f2.

Files selected for processing: 4
  • annot/src/main/java/com/predic8/membrane/annot/generator/JsonSchemaGenerator.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/YamlDocsGenerator.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java
  • distribution/src/test/java/com/predic8/membrane/examples/ApisYamlSchemaValidationTest.java
Files with no reviewable changes: 2
  • distribution/src/test/java/com/predic8/membrane/examples/ApisYamlSchemaValidationTest.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

Schema generation no longer adds the legacy id field. YAML documentation format version 2 includes every element and records its JSON Schema definition key. The schema validation test now passes the loaded schema to the registry without removing id keywords first.

Changes: Schema generation and YAML documentation

Layer / File(s) Summary
Remove legacy schema IDs
annot/src/main/java/com/predic8/membrane/annot/generator/JsonSchemaGenerator.java, annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java, distribution/src/test/java/com/predic8/membrane/examples/ApisYamlSchemaValidationTest.java
Parser schemas are no longer tagged with element IDs, and AbstractSchema no longer serializes an id. The validation test no longer strips id keywords before creating the schema registry.
Record schema keys in YAML documentation
annot/src/main/java/com/predic8/membrane/annot/generator/YamlDocsGenerator.java
The documentation format version changes to 2. Collection now includes elements without documentation and records each element’s JSON Schema definition key.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related issues

  • membrane/api-gateway#3602 — The issue describes removing legacy id fields from generated JSON Schema definitions and adding the definition-to-element mapping as jsonSchemaDef in docs.yaml.

Suggested reviewers: predic8

Merge Risk: Minimal · up to 41cc5

No actionable merge-blocking risk was established by the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names two changes: moving the element id mapping to docs.yaml and dropping the legacy "id" keyword. The raw summary shows the id field and id(String) setter removed from AbstractSchema, the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes: moving the element id mapping to docs.yaml and dropping the legacy "id" keyword. The raw summary shows the id field and id(String) setter removed from AbstractSchema, the tagElementId id assignment removed from JsonSchemaGenerator, and stripLegacyIdKeyword removed from the test. It also shows YamlDocsGenerator changed to version 2 and emitting every element with its schema key from getXSDTypeName. The summary does not clearly show a docs.yaml mapping being added, so the title is only partly supported. The title still refers to real, central parts of the change, so it passes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the schema rows,
No legacy id remains to show.
Each element gets its key in view,
The YAML lists the undocumented too.
I nibble clover, then hop through.

Comment @coderabbitai help to get the list of available commands.

@christiangoerdes

Copy link
Copy Markdown
Collaborator Author

/ok-to-test

@membrane-ci-server

Copy link
Copy Markdown

This pull request needs "/ok-to-test" from an authorized committer.

@christiangoerdes
christiangoerdes merged commit 8a12a6f into master Oct 27, 2026
6 checks passed
@christiangoerdes
christiangoerdes deleted the fix/schema-remove-legacy-id branch October 27, 2026 14:51
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.

JSON schema: replace the legacy "id" keyword, networknt fails on it under draft 2020-12

2 participants