-
-
Notifications
You must be signed in to change notification settings - Fork 578
Open
Labels
bugSomething isn't workingSomething isn't working
Description
To Reproduce
- Use OpenAPI integration
- Add a field with the following type to the openapi.json specification:
{
"options": {
"type": "array",
"description": "Description",
"items": {
"type": "string",
"enum": [
"FIRST",
"SECOND",
"THIRD"
]
}
}
}Current vs. Expected behavior
Current behavior:
A field of type array<string> is displayed without info tags.
Expected behavior:
A field of type array<string> is displayed with info tag "Value in" or something like that (e.g. "Item value in")
This also needs to be thought out for a nesting arrays (e.g. array<array<string>>)
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 8
Binaries:
Node: 22.15.0
npm: 10.9.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 16.1.1 // There is a newer version (16.1.2) available, upgrade recommended!
eslint-config-next: 15.5.2
react: 19.2.3
react-dom: 19.2.3
typescript: 5.9.2
Next.js Config:
output: standaloneWhich area(s) are affected? (Select all that apply)
UI
Additional context
A naive implementation might look something like this:
// https://github.com/fuma-nama/fumadocs/blob/dev/packages/openapi/src/ui/schema/index.tsx
function findNestedEnum(schema: ResolvedSchema): string[] | null {
if (schema.enum) {
return schema.enum
{
if (schema.items) {
return findNestedEnum(schema.items)
}
return null
}
function generateInfoTags(schema: Exclude<ResolvedSchema, boolean>) {
// ...
let nestedEnum = schema.items && findNestedEnum(schema.items)
if (nestedEnum) {
fields.push(field('Item value in', nestedEnum.map((value) => JSON.stringify(value)).join(' | ')));
}
}coderabbitai
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working