Skip to content

cover cafe api#3

Merged
tatomyr merged 8 commits intomainfrom
cover-cafe-api
Jan 19, 2026
Merged

cover cafe api#3
tatomyr merged 8 commits intomainfrom
cover-cafe-api

Conversation

@tatomyr
Copy link
Copy Markdown
Owner

@tatomyr tatomyr commented Jan 19, 2026

v0.3.0:

  • remove $discriminator and convert discriminators to OR/anyOf
  • add generateNamedSchemas and removeSchemas decorators
  • handle merging more (primitive) types; improve $omit to handle ORs
  • fix extracting arrays and improve formats conversion in json-schema-adapter
  • cleanup pets, update back-to-schemas, use 1-level-depth schemas for the sake of simplicity

…merging more (primitive) types; improve $omit to handle ORs; fix extracting arrays and improve formats conversion in json-schema-adapter
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 19, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 40.3% 509 / 1263
🔵 Statements 40.3% 509 / 1263
🔵 Functions 40% 16 / 40
🔵 Branches 82.5% 198 / 240
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
applications/json-schema-adapter.js 52.34% 75.67% 75% 52.34% 41, 54-55, 60-61, 63-64, 72-73, 81, 85-86, 90-146, 161-162, 173-192, 210-214, 219-220, 224-228, 231-232, 236-249, 254-256
applications/x-types-adapter.js 87.5% 90.78% 33.33% 87.5% 47-48, 55-56, 59-60, 79-81, 100-102, 206-218, 222-224
applications/x-types-decorators.js 0% 0% 0% 0% 1-248
applications/x-types-plugin.js 0% 0% 0% 0% 1-164
applications/x-types-resolver.js 75.58% 92.59% 50% 75.58% 5-19, 38-41, 47-48
applications/x-types-utils.js 86.36% 84.21% 71.42% 86.36% 13, 40-41, 51-52, 68-69, 73, 75-76, 93-94, 96-97, 117-119, 132
Generated in workflow #101 for commit fc2a088 by the Vitest Coverage Report Action

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread applications/json-schema-adapter.js Outdated
Comment thread applications/json-schema-adapter.js
Comment thread applications/x-types-decorators.js
Comment thread applications/x-types-adapter.js Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Repository owner deleted a comment from Copilot AI Jan 19, 2026
@tatomyr tatomyr merged commit 4163548 into main Jan 19, 2026
2 checks passed
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.

2 participants