Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript to OpenApi #25

Open
captainrdubb opened this issue Jun 9, 2022 · 1 comment
Open

TypeScript to OpenApi #25

captainrdubb opened this issue Jun 9, 2022 · 1 comment

Comments

@captainrdubb
Copy link

captainrdubb commented Jun 9, 2022

I would like to serve multiple versions of an api from a single web service. I also don't want to write OpenApi schemas. I want to write TypeScript, then I want to convert that to OpenApi. I am able to convert from TS to OpenApi (thanks!), however, I need to support multiple schema versions. If my project dirs look something like this...

.
`-- src/
    |-- business/
    |   `-- dtos/
    |       |-- v1/
    |       |   `-- index.ts
    |       `-- v2/
    |           `-- index.ts
    `-- customer/
        `-- dtos/
            |-- v1/
            |   `-- index.ts
            `-- v2/
                `-- index.ts

then i want the schema to look something like

{
    ...
    components:{
        schemas: {
            v1: {
                ...
            },
            v2:{
                ...
            }
        }
    }
}
@captainrdubb
Copy link
Author

captainrdubb commented Jun 9, 2022

extending the example above, one of the index.ts files may have an interface like...

export interface Customer {
    name: string;
    creditCardNumber: string
    socialSecurityNumber: string
    streetAddress: string
    passportId: string
    dateOfBirth: string
    isHouseKeyUnderMat: boolean
}

export interface AttackAnimal {
    isExoticPet: boolean
    isillegal: boolean
    isTerritorial: boolean
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant