swagger-typescript-api | TypeScript API generator via Swagger scheme | REST library
kandi X-RAY | swagger-typescript-api Summary
kandi X-RAY | swagger-typescript-api Summary
TypeScript API generator via Swagger scheme
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of swagger-typescript-api
swagger-typescript-api Key Features
swagger-typescript-api Examples and Code Snippets
Community Discussions
Trending Discussions on swagger-typescript-api
QUESTION
We have the following OpenAPI schema:
...ANSWER
Answered 2021-Jul-19 at 12:01From what I understood reading the OpenAPI specification, oneOf
and type
are not supposed to be used together. It doesn’t seem to have been stated explicitly, but examples in the specification use one or the other, never both. I assume the TypeScript binding generator, upon seeing that type
is "object"
, simply constructs the type based on properties
and ignores the oneOf
.
If you want to distinguish the type
property as disambiguating between the types in the union, you should use discriminator
instead of properties
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install swagger-typescript-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page