Add availability metadata to examples#6446
Merged
Merged
Conversation
3 tasks
Contributor
|
Following you can find the validation changes against the target branch for the APIs. No changes detected. You can validate these APIs yourself by using the |
|
Thanks @lcawl. I think we will need a follow up to make the following fix. We refer to the following GLOBALLY_REJECTED_PARAMETERS in many places in the serverless specs: We will need to filter those out. LGTM otherwise. |
ankikuma
approved these changes
Jul 16, 2026
l-trotta
approved these changes
Jul 17, 2026
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.19 8.19
# Navigate to the new working tree
cd .worktrees/backport-8.19
# Create a new branch
git switch --create backport-6446-to-8.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4fcfdc57fa218487d0ab56048f83c99c3cb4fb59
# Push it to GitHub
git push --set-upstream origin backport-6446-to-8.19
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.19Then, create a pull request where the |
Contributor
|
AI Backport Resolver resolved conflicts and created a backport PR: #6494 Files with AI-resolved conflicts:
|
l-trotta
pushed a commit
that referenced
this pull request
Jul 17, 2026
l-trotta
added a commit
that referenced
this pull request
Jul 17, 2026
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.
Solves #5197
Summary
Adds optional
availabilitymetadata to request and response example YAML files so the OpenAPI generator can include or exclude examples by Stack vs Serverless context. This addresses #5197 with a source-level solution instead of post-generation overlays (e.g. #6414).Example YAML files can now declare:
When omitted, examples apply to all contexts (no migration required for existing examples).
The compiler normalizes this list into the existing
Availabilitiesmetamodel shape, and the availability filter removes non-matching examples before OpenAPI generation. That affects:requestBody/ responseexamplesx-codeSamples(which uses the first remaining request example after filtering)Availability is used only for filtering; it is not emitted into OpenAPI output.
Changes
availabilitytoExample/SchemaExample(TS + Rust).add-examples.ts): Parse, validate, and normalizeavailability: [stack|serverless]from YAML.availability.rs,filter-by-availability.ts): Filter request and response examples by flavor alongside endpoints and properties.[stack], Example2 →[serverless][stack]; new Example4–6 →[serverless](empty body, mappings-only, aliases without routing)add-new-api.mdandmodeling-guide.md.compiler-wasm-libto pick up Rust changes.Examples
When I run
make transform-to-openapi-for-docsandmake overlay-docs, I see changes like this:indicesRolloverRequestExample2has been removed from the Stack-specific OpenAPI documentindicesRolloverRequestExample1has been removed from the Serverless-specific OpenAPI documentindicesCreateRequestExample1exists only in the Stack-specific OpenAPI documentGenerative AI disclosure
Tool(s) and model(s) used: Composer 2.5