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

Closed
khaledboubtan opened this issue Dec 6, 2024 · 0 comments · Fixed by #1144
Closed

Using a TypeScript Configuration File #1005

khaledboubtan opened this issue Dec 6, 2024 · 0 comments · Fixed by #1144
Labels
enhancement New feature or request

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"

},

@smorimoto smorimoto added the enhancement New feature or request label Mar 26, 2025
@smorimoto smorimoto linked a pull request Mar 26, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants