Skip to content

Using a TypeScript Configuration File #1005

@khaledboubtan

Description

@khaledboubtan

I want to use a TypeScript configuration file. I used a .js configuration file and it works to generate a model that contains dates, but I couldn't do it using a TypeScript file. Is there a solution? If not, is there another way to generate the date type from a string format date and DateTime?
the config.js File :
const primitiveTypeConstructs = (constructs) => ({
...constructs,
string: {
'date-time': () => 'Date',
'date': () => 'Date',
},
});

module.exports = {
primitiveTypeConstructs,
};

package.json : scripts": {

"openapi:generate": "swagger-typescript-api -p ./open-api/open-api.yaml -o ./src/models  --custom-config  ./open-api/config  --no-client"

},

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions