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

[kotlin] add option for non public api #4089

Merged
merged 9 commits into from
Oct 10, 2019

Conversation

4brunu
Copy link
Contributor

@4brunu 4brunu commented Oct 7, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04)

Description of the PR

I'm integrating the generated code inside a library I'm creating and I would like for the generated code to no be exposed.
It would be nice to have an option for the generated code to be internal.
This fix #4088
I used the same approach that is used in the C# generator

@auto-labeler
Copy link

auto-labeler bot commented Oct 7, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

4brunu added 6 commits October 9, 2019 09:29
# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java
# Conflicts:
#	modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ResponseExtensions.kt.mustache
Copy link
Member

@jimschubert jimschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I just had a couple questions.

# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java
#	modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
#	samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
#	samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt
#	samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt
#	samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt
#	samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt
#	samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt
Copy link
Member

@jimschubert jimschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@4brunu
Copy link
Contributor Author

4brunu commented Oct 10, 2019

@jimschubert nice 👍 can you merge this PR?

@wing328 wing328 added this to the 4.2.0 milestone Oct 10, 2019
@wing328 wing328 merged commit 3cd74f4 into OpenAPITools:master Oct 10, 2019
@4brunu 4brunu deleted the kotlin-visibility branch October 10, 2019 14:01
jimschubert added a commit that referenced this pull request Oct 14, 2019
* master: (78 commits)
  Replaced dashes with underscores in build.gradle files. (#4092)
  [cxf-cdi] use @FormParam for form parameters when it is not Multipart (#4125)
  Corrections to script names (#4135)
  [python] Add missing keywords python (#4134)
  Update PULL_REQUEST_TEMPLATE.md (#4080)
  revert the fix to broken links
  Rename property name from propertyRawName to propertyBaseName (#4124)
  [Go] Fix go.mod and go.sum for 1.13 (#4084)
  [kotlin] add option for non public api (#4089)
  Added new discriminator RawName property to preserve declared discriminator for @JsonTypeInfo annotations (#3320)
  Fix links to other files (#4120)
  [JAVA][JAXRS] Fix parameters validation (#3862)
  Make Resttemplate thread safe by using the withHttpInfo pattern used by many other generated clients (#4049)
  Disabling linting for typescript-fetch (#4110)
  [Kotlin][Client] fix missing curly bracket when the model contains enum property (#4118)
  Fix NPE in Elm path parameter (#4116)
  test aiohttp first (#4117)
  add back ruby client folders
  update petstore samples
  [CLI] Initial implementation for batch generation (#3789)
  ...
@priettt
Copy link

priettt commented Jan 30, 2024

@jimschubert @4brunu Sorry to revive such an old PR, but I have two questions:

  • Should nonPublicApi appear in the kotlin generator docs?
  • Should adding this property through configOptions also be supported? It's only working if I add it in additionalProperties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ] Kotlin generator with non public API
4 participants