Comments (14)
@mrlubos sure, I've create test stand for you, just clone repo and follow instructions
https://github.com/bondars95/typescript-codegen-issue
from openapi-typescript-codegen.
Hello Guys,
@ferdikoomen could you please have a look?
from openapi-typescript-codegen.
@bondars1995 are you able to create a failing test case?
from openapi-typescript-codegen.
@bondars95 thanks! How do you generate that OpenAPI spec? I am trying to understand what kind of types generate that output
from openapi-typescript-codegen.
@mrlubos as mentioned in package.json
npx openapi-typescript-codegen --input spec.yaml --output ./generated --exportServices=false --exportCore=false
from openapi-typescript-codegen.
@mrlubos and error is coming when compiling generated files with typescript
tsc generated/index.ts
from openapi-typescript-codegen.
@mrlubos did you have any chance to have a look into it?
from openapi-typescript-codegen.
@bondars95 not yet, because it's not clear to me:
- what's the expected result based on the OpenAPI spec provided
- how you're able to generate that OpenAPI spec in your backend language (which tooling do you use?)
from openapi-typescript-codegen.
@mrlubos openapi spec created manually
just wondering why it is causing issues with typescript generated types, maybe smth can be changed in typescript generation
from openapi-typescript-codegen.
@bondars95 did it work on any of the previous versions? What result would you expect?
from openapi-typescript-codegen.
@mrlubos I didn't check, but I suppose I will get same error, just wanted to check if it can be fixed somehow from your side.
from openapi-typescript-codegen.
@bondars95 please refer to my earlier messages
from openapi-typescript-codegen.
@mrlubos I've got your point here, we need type descriminator for generating java classes
oneOf is used just for correct displaying on UI in swagger
when using both discriminator and oneOf it breaks typescript generation
Any way I can tell openapi-typescript-codegen to omit generating part related to discriminators? Or to ignore one of them if both discrimator and oneOf is present?
Cause using both discriminate and one of cause circular reference for typescript
from openapi-typescript-codegen.
@mrlubos in my case let's say expected behaviour would be having PaymentMethod generated without having reference to CardPaymentMethod not to cause circular reference
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type PaymentMethod = ({
type: string;
});
it obviously can be achieved by removing discrimantor, but this causes other issues
from openapi-typescript-codegen.
Related Issues (20)
- getFormData causes issue in submitting files HOT 1
- Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher. HOT 22
- Relative external references for Angular client doesn't work HOT 1
- OpenAPI.ts `Resolver` typing is annoying, should use a `Maybe` type
- While resolving: [email protected] HOT 1
- Unable to run when redocly is installed HOT 2
- Option to rename `requestBody` HOT 1
- Select/Filter Tags to generate specific Services only HOT 1
- Literal fields are converted to optional any HOT 5
- Adding the option to remove certain or all file headers. HOT 1
- Referenced nullable object types are not generated as possibly null HOT 4
- anyOf combining literals and objects generates incorrect code HOT 6
- Ability to process multiple input files HOT 5
- all Of -> $reference. HOT 3
- If all parameters are optional, make the top level object optional too HOT 4
- Generated type definitions should not include the error case HOT 3
- Relative path seems to be based on the node_modules directory and not the cwd HOT 3
- Support for Server Side Event HOT 3
- Wrong path on Windows HOT 16
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 openapi-typescript-codegen.