-
Notifications
You must be signed in to change notification settings - Fork 29
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
Ability to generate client from openapi specification for build #631
Comments
I understand what you are saying. I use Orval to generate my TypeScript for React Query from OpenApi right now I have to do it as 2 steps. Generate the OpenApi JSON then I copy that to my webui and run |
I am using it using this kind of configuration: application.properties: quarkus.smallrye-openapi.store-schema-directory=src/main/webui/
mp.openapi.extensions.smallrye.operationIdStrategy=METHOD package.json {
// ...
"scripts": {
"dev": "orval --config ./orval.config.ts && react-scripts start",
"build": "orval --config ./orval.config.ts && react-scripts build",
"test": "react-scripts test --env=jsdom"
},
// ...
} This way endpoints are generated add dev starting and build stages. No need to generate next copy to webui |
Wow this is awesome! Going to try it tomorrow! |
@dcdh this is the life changing need i was looking for! I use Vite and Orval and do this and it works like a charm to autogenerate the TypeScript. "scripts": {
"format": "prettier --write \"{src,__tests__}/**/*.{ts,tsx}\"",
"codegen": "orval && npm run format",
"dev": "npm run codegen && vite",
"build": "tsc && vite build",
}, |
@dcdh ok i am adding this to the docs for other people in the future. |
Feature idea
Following this project https://github.com/dcdh/formula-interpreter/blob/master/pom.xml
the openapi-generator-maven-plugin is used to generate client in typescript based on openapi yaml file produce by the quarkus-smallrye-openapi dependency.
The build is done this way:
Regarding quinoa, building the openapi.yaml and the project is done in only one phase at build one. So I am not able generate my typescript client after openapi.yaml generation and before building the project.
So it will be nice if it was possible split the build into two: build for backend services and prepare-package for frontend one with the ability to do something between them (like code generation).
Regards,
Damien
Additional information
The text was updated successfully, but these errors were encountered: