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

Using a TypeScript Configuration File #1005

Open
khaledboubtan opened this issue Dec 6, 2024 · 0 comments
Open

Using a TypeScript Configuration File #1005

khaledboubtan opened this issue Dec 6, 2024 · 0 comments

Comments

@khaledboubtan
Copy link

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"

},

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