-
-
Notifications
You must be signed in to change notification settings - Fork 584
Closed as not planned
Labels
bugSomething isn't workingSomething isn't workingopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript librarystale
Description
Hello everyone :)
Description
When using --array-length flag and minItems, maxItems with identical values in schema definition, the generated interface is [].
Name | Version |
---|---|
openapi-typescript |
>=7.0.0 |
Node.js | 20.15.0 |
OS + version | Windows 10 |
Reproduction
Run openapi-typescript with --array-length flag set to true on yaml :
openapi: 3.1.0
info:
title: Webhook Example
summary: My lovely API
version: 1.0.0
description: some description
license:
name: MIT
identifier: MIT
url: https://opensource.org/licenses/MIT
jsonSchemaDialect: https://spec.openapis.org/oas/3.1/dialect/base
tags:
- name: Gameplay
description: gameplay tag
servers:
- url: https://redocly-example.com/{var}
variables:
var:
enum:
- a
- b
default: b
security: []
paths:
/pets/items:
get:
operationId: getTest
summary: Get Test! Foo! Etc!
responses:
200:
description: '200'
content:
application/json:
schema:
type: array
items:
type: string
minItems: 3
maxItems: 3
400:
description: An error response
Expected Result
The part "application/json" should be typed as "[string, string, string]" in :
responses: {
/** @description 200 */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": [string, string, string];
};
};
Current Result
responses: {
/** @description 200 */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": [];
};
};
Checklist
- My OpenAPI schema passes the Redocly validator (
npx @redocly/cli@latest lint
) - I’m willing to open a PR (see CONTRIBUTING.md)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript librarystale