-
Notifications
You must be signed in to change notification settings - Fork 4
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
New property generateApi #28
base: master
Are you sure you want to change the base?
Conversation
|
||
### Added: | ||
- (Kotlin) Add a new parameter `generateApi` you can enable/disable to generate API with infrastructure. | ||
If you set it to false, only model classes will be generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set it to false api classes will not be generated. Model to nijak neovlivňuje. Pokud bys pak měl i proměnnou na model tak tohle už nebude pravda protože generateApi != generateModel.
@@ -82,7 +83,8 @@ configure<SwaggerCodeGenConfig> { | |||
- `templateEngine` - Currently this generator is supporting only `mustache`. Support of `handlebars` is in a progress. | |||
- `dateLibrary` - By this property you can set date library used to serialize dates and times. | |||
- `enumPropertyNaming` - By this property you can change enum property naming style. ("camelCase", "PascalCase", "snake_case", "original", "UPPERCASE") | |||
- `generateInfrastructure` - By this property you can enable to generate API infrastructure. | |||
- `generateApi` - By this property you can enable/disable to generate API with infrastructure. If you set to false, only a model classes will be generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opět model bych nezmiňoval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technicky by to asi měl být i enum. API_INFRA, API, NOTHING. :) Ale nevím jestli se dají enumy poslílat přes tuhle konfiguraci.
@@ -28,7 +61,8 @@ import java.io.File | |||
* | |||
* Additional generator options: | |||
* - `dateLibrary` - By this property you can set date library used to serialize dates and times. | |||
* - `generateInfrastructure` - By this property you can enable to generate API infrastructure. | |||
* - `generateApi` - By this property you can enable/disable to generate API with infrastructure. If you set to false, only a model classes will be generated. Default is true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opět model.
if (!generateApi) { | ||
apiDocTemplateFiles.clear() | ||
apiTemplateFiles.clear() | ||
if (additionalProperties.containsKey(GENERATE_API)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asi nechápu ale není tahle kontrola zbytečná? To máš obražené v tom generateApi = řádku.
additionalProperties[DateLibrary.THREETENBP_LOCALDATETIME.value] = false | ||
typeMapping["local-date-time"] = "kotlinx.datetime.LocalDateTime" | ||
typeMapping["date-time"] = "kotlinx.datetime.LocalDateTime" | ||
typeMapping["DateTime"] = "LocalDateTime" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kotlinx nemá pouze DateTime? Se mi zdá celkem naprd.
generateApi
you can enable/disable to generate API with infrastructure.If you set it to false, only model classes will be generated.