Conversation
…merging more (primitive) types; improve $omit to handle ORs; fix extracting arrays and improve formats conversion in json-schema-adapter
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This pull request adds support for the Redocly Cafe API as a comprehensive example and enhances the x-types system with improved discriminator handling and additional features.
Changes:
- Added comprehensive Cafe API files (cafe.yaml and cafe.x-type.yaml) demonstrating OAuth2, discriminators, webhooks, and various OpenAPI patterns
- Enhanced discriminator support to automatically generate Base_ schemas and inject discriminator property values into subschemas
- Improved x-types functionality with reserved keyword escaping, const support, integer format handling (int32, int64), and exclusive min/max bounds
- Renamed configuration files from x-redocly.yaml to x-type.redocly.yaml for consistency
- Added new decorators (generateNamedSchemas, removeSchemas) for schema management
- Updated documentation to clarify discriminator usage and readOnly/writeOnly limitations
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| redocly.yaml | Updated reference to new config file name |
| package.json | Added cafe API npm scripts and updated config references |
| extensions.md | Commented out discriminator documentation section |
| applications/x-types-utils.js | Added RESERVED_KEYWORDS and enhanced deepMergeTwo for string literal handling |
| applications/x-types-resolver.js | Refactored omit function to support arrays |
| applications/x-types-plugin.js | Registered new decorators |
| applications/x-types-decorators.js | Added generateNamedSchemas and enhanced discriminator handling in generateNamedXTypes |
| applications/x-types-adapter.js | Changed error handling from throw to console.error, added int32/int64/uri-reference format support, removed discriminator from schema output |
| applications/json-schema-adapter.js | Added reserved keyword escaping, const support, enhanced format handling, and discriminator transformation logic |
| applications/resources/cafe.yaml | New comprehensive Cafe API demonstrating various OpenAPI features |
| applications/resources/cafe.x-type.yaml | X-types version of the Cafe API |
| applications/remove-x-types.redocly.yaml | New config file for removing x-types |
| applications/x-type.redocly.yaml | Renamed from x-redocly.yaml with generateNamedSchemas preprocessor added |
| applications/generate-x-types.redocly.yaml | Added removeSchemas decorator |
| applications/resources/openapi-with-discriminators.yaml | Reorganized schema order and removed x-types section |
| Test files | Updated config references and snapshots to reflect changes |
| NOTES.md | Added discussion about readOnly/writeOnly limitations and x-types advantages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cccf1c8 to
fa6c2e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.3.0: