ozonophore / openapi-codegen Goto Github PK
View Code? Open in Web Editor NEWA simple library that generates TS-interface models from openapi specification
License: MIT License
A simple library that generates TS-interface models from openapi specification
License: MIT License
You must be able to choose whether the query interface is canceled or simple. You need to add a cli parameter to select the interface.
If the specification specifies the refine in this way $ref: ../openapi_example/viewExampleDto.yml. Then the generation of models occurs in another directory above.
This violates the integrity of the structure of the generated directory and models.
The problem is still relevant. It's not enough to remove the jump to the directory above. The issue has been identified in model paths, model imports, and schema imports.
According to specification, an enum can contain only name, values are situated in a description.
Example:
schema:
type: string
enum: [asc, desc]
description: >
Sort order:
* asc
- Ascending, from A to Z
* desc
- Descending, from Z to A
Need to add cancelable concept. This will allow you to correctly cancel requests and handle further scripts.
Generated paths can be useful for stabbing in tests
Example
interface IConfig {
path: string;
method: 'post' | 'delete' | 'get'
}
export const serviceConfig = (baseUrl: string): IConfig => {
return {
getUser: {
path: `${baseUrl}/users`,
method: 'get',
}
getUsersById: {
path: `${baseUrl}/users/:id`,
method: 'get',
},
}
};
in test:
const config = getServiceConfig('rest/v1');
const configForGetUser = config['getUser'];
export const handler = rest[configForGetUser.method](configForGetUser.users, (_, res, ctx) => {
return res(ctx.status(200));
})
If the specification specifies the refine in this way $ref: ../openapi_example/viewExampleDto.yml
. Then the generation of models occurs in another directory above.
This violates the integrity of the structure of the generated directory and models.
Example:
$ref: ./file.yaml#/components/AnyComponent
I expect that generator will create an interface AnyComponent in the models folder
Describe the solution you'd like
A clear and concise description of what you want to happen. Ideally with a small example of the proposed changes.
Describe the solution you'd like
A clear and concise description of what you want to happen. Ideally with a small example of the proposed changes.
Actual result: OpenApi configuration is hardcoded. There is no way to manually specify parameters - BASE, VERSION, WITH_CREDENTIALS, TOKEN, USERNAME, PASSWORD, HEADERS.
Expected result: in the custom request file you can specify the OpenApi configuration for further use.
Add parameters to config:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.