Repository navigation
fix(rapidoc): show untyped annotated schemas as any and primitive oneOf options on one row - #1164
Merged
mrin9 merged 2 commits intoNov 1, 2026
Conversation
getTypeInfo only returned "any" for a completely empty schema. As soon as an
untyped schema carried a description (e.g. an `items` documented as "A string,
a number or a boolean"), the schema table rendered {missing-type-info}.
A schema that only carries annotations (title, description, example(s),
default, deprecated, readOnly, writeOnly, externalDocs, x-*) is now "any".
A schema with constraints but no type (e.g. minLength) still reports a missing
type.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A primitive option (string, number, boolean...) of a oneOf/anyOf took two rows: the OPT n badge, then a row named "Option n" repeating it before the type. The badge (and the title if any) now sits in the key cell of the primitive row, next to its type and description. Titled options and untitled objects/arrays keep their header row, it carries the description and hosts the children. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator
|
Thanks for taking this one on urself |
mrin9
added a commit
that referenced
this pull request
Nov 1, 2026
Raise the range floors of @astrojs/starlight, @scalar/openapi-parser, @apidevtools/json-schema-ref-parser, hono, @hono/node-server and openid-client to their latest patch releases and regenerate the lockfile. Every direct dependency was already on its latest major. Rebuild rapidoc-min.js so the tracked bundle carries the untyped-schema and primitive-oneOf fixes merged from #1164.
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.
Summary
Two small fixes in the schema table, both seen on a real API that uses
oneOfand untypedschemas. They are independent, one commit each.
1. Untyped schemas that only carry annotations are shown as
anygetTypeInfoonly returnedanyfor a completely empty schema. As soon as an untypedschema had a description, the table rendered
{missing-type-info}:filter [{missing-type-info}]filter [any]A schema that only has annotation keywords (
title,description,example,examples,default,deprecated,readOnly,writeOnly,externalDocs,x-*) is nowany.A schema with constraints but no type (e.g.
minLength: 3) still reports a missing type.2. A primitive option of a
oneOf/anyOftakes one row instead of twoA primitive option (
string,number,boolean...) was rendered as theOPT nbadge row,then a second row named
Option nthat repeated it before the type:The badge (and the option title, if any) now sits in the key cell of the primitive row:
Titled options and untitled objects/arrays are unchanged: their header row carries the
description and hosts the children, so it is kept.
Tests
tests/unit/schema-utils.test.js:getTypeInforeturnsanyfor annotation-only schemas(including
x-*), and still reports a missing type for{ minLength: 3 }.tests/unit/schema-ast.test.js: untitled primitive options are unnamed, titled options anduntitled objects keep their name.
npm run test:unit(472 pass),oxlint --deny-warnings,oxfmt --check.(screenshots attached).
I did not run the e2e / visual suites, which may compare screenshots of the schema table.