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

New property generateApi #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vsouhrada
Copy link
Collaborator

  • (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.

@vsouhrada vsouhrada added the enhancement New feature or request label May 10, 2021
@vsouhrada vsouhrada requested a review from Del-S May 10, 2021 12:23

### 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.
Copy link
Collaborator

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.
Copy link
Collaborator

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.

Copy link
Collaborator

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
Copy link
Collaborator

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)) {
Copy link
Collaborator

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"
Copy link
Collaborator

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.

@Del-S Del-S assigned vsouhrada and unassigned Del-S May 10, 2021
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 this pull request may close these issues.

2 participants