Skip to content

Conversation

@nonoakij
Copy link
Contributor

Describe the pull request

Add support for the const keyword available in OpenAPI 3.1.0. When a schema defines const, it now displays the allowed value with an "Allowed value:" label.

Why

OpenAPI 3.1.0 is a superset of JSON Schema Draft 2020-12 and supports the const keyword (OpenAPI 3.1.0 Specification). The const keyword indicates that a value must be exactly equal to a specified constant value (JSON Schema Draft 2020-12).

Previously, starlight-openapi ignored the const keyword, so the allowed value was not displayed in the documentation.

How

Added const property to the Items type
Implemented display of "Allowed value:" tag in Items.astro component when const is present
Uses a consistent UI pattern with the existing enum display ("Allowed values:")

Screenshots

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: e17eb5f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
starlight-openapi Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 15, 2026

@nonoakij is attempting to deploy a commit to the HiDeoo's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
starlight-openapi Ready Ready Preview, Comment Jan 16, 2026 1:43pm

Copy link
Owner

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🙌

I took the liberty of adding one small test and a changeset so we can ship the change immediately.

@HiDeoo HiDeoo merged commit 2e813b1 into HiDeoo:main Jan 16, 2026
2 of 3 checks passed
@github-actions github-actions bot mentioned this pull request Jan 16, 2026
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