Comments (2)
Thank you @horiuchi !
from dtsgenerator.
Multiple requestBody
s are not supported at this time.
When I actually tried, only the previously defined type is output, as shown below.
- Input Schema
openapi: '3.0.2'
info:
title: example schema
version: v0.1
components:
schemas:
json:
type: object
properties:
id:
type: string
form:
type: object
properties:
id:
type: number
responses:
created:
description: 'object created'
paths:
'/Create':
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/json'
multipart/form-data:
schema:
$ref: '#/components/schemas/form'
responses:
204:
$ref: '#/components/responses/created'
- Response
declare namespace Components {
namespace Responses {
export interface Created {
}
}
namespace Schemas {
export interface Form {
id?: number;
}
export interface Json {
id?: string;
}
}
}
declare namespace Paths {
namespace Create {
namespace Post {
export type RequestBody = Components.Schemas.Json;
namespace Responses {
export type $204 = Components.Responses.Created;
}
}
}
}
from dtsgenerator.
Related Issues (20)
- Support OpenAPI 3.1
- Support `JSON Schema 2020-12` HOT 1
- Use of "oneOf" is not working properly HOT 2
- null choices in nullable enums is cast in string HOT 2
- When definitions are not defined, we hope to be compatible without affecting the export of d.ts file HOT 1
- --useUnionTypes doesn't work on $ref
- Type generation malforming objects with number-like keys HOT 5
- AdditionalProperties in swagger definition creates broken TS interface HOT 9
- Move this project and generate result to ESM HOT 2
- Common Parameters for Various Paths Different API paths not resolved correctly HOT 7
- complex nullable type, change in behavior HOT 4
- [Question] Is it possible to export the namespace? HOT 3
- If there are 8s and 9s, they will be zero-suppressed. HOT 3
- Nesting multiple, separate objects defined with oneOf in allOf does not work as expected HOT 2
- jsdoc comments are placed after property name
- How do I suppress long prefices? HOT 1
- All interface properties made optional HOT 2
- nested interfaces? HOT 3
- importing the lib? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtsgenerator.