-
Notifications
You must be signed in to change notification settings - Fork 6k
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
How to generate individual files for models #4700
Comments
@Stwissel is this for a particular language (e.g. Java, C#, etc) or a new language/generator that you're working on? |
For a new generator. It will generate the server code for the IBM Domino
NoSQL server.
On Fri, 3 Feb 2017 at 16:32, wing328 ***@***.***> wrote:
@Stwissel <https://github.com/Stwissel> is this for a particular language
(e.g. Java, C#, etc) or a new language/generator that you're working on?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4700 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAhHVWARB68E1HT0Z4iLXh6nBlEHPWK6ks5rYuYTgaJpZM4L2EhM>
.
--
Mobile message, pegged on glass.
Best regards
Stephan H. Wissel
http://www.wissel.net/
|
I think a good starting point is to look at how model test files are generated. e.g. each PHP model comes with a model test file for testing the model (developers can update it with test cases to ensure the PHP model class is working properly). The following PR is a good starting point:
I think this will be similar to the auto-generated README, e.g. https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/php/README.mustache#L106-L107 Let us know if you need further assistance. |
@Stwissel you can also see here how to control the models being generated: https://github.com/swagger-api/swagger-codegen#selective-generation Please reopen with any other questions |
I got the generation of my form and view files out of my model working. The missing piece now it how to get them into their own directories. Like modeloutputdir/form/form1.form and modeloutputdir/view/view1.view |
@Stwissel there are some methods you can override to customize the path or file name, e.g. |
Had a look at them. Probably I'm blur like sotong here. Where's that method where the full path name gets assembled. The one path + filename + extension ? |
There's no one single function you can override to assemble the full path (path + filename + extension). Can you submit a PR (WIP) so that we can review what you've so far? |
I'll finish my code first ( I can use a shell script to move things around for the time being) then do a PR (wip) |
@Stwissel do you need help with the PR? We look forward to the first generator for database schema. |
Description
Clarification request: How to generate individual model files.
I'm creating my own code generator for an IBM Domino database "schema" (will contribute it back here when I get it to work). One of the big questions I couldn't find an answer is:
I need to generate multiple files out of each model definition. E.g. I have:
definitions:
order
customer
product
I need to generate
forms/order.form
forms/customer.form
forms/product.form
views/order_view.view
views/customer_view.view
views/product_view.view
manifest.mf <-- this one needs the list of files generated
How do I configure codegen to write to individual files?
Swagger-codegen version
2.2.1
The text was updated successfully, but these errors were encountered: