SMILEY4 / ktor-swagger-ui

Kotlin Ktor plugin to generate OpenAPI and provide Swagger UI
Apache License 2.0
180 stars 33 forks source link

Add ability to hide properties on objects #133

Closed Skater901 closed 1 month ago

Skater901 commented 1 month ago

I have a few request objects that have extra properties that I don't want to be included in the generated documentation. However, there doesn't seem to be a way to hide them, equivalent to using the Swagger @Hidden annotation.

Example:

data class MyRequestClass(
    val myPublicProperty: String,
    val myOtherPublicProperty: String,
    val mySuperSecretPropertyThatCantBeDocumented: String // <-------- how do I hide this from the generated documentation?
)
Skater901 commented 1 month ago

Hmm actually this may be achievable by using the Jackson module of the schema-kenerator and using the @JsonIgnore annotation... if it is, I'll close this issue.

Skater901 commented 1 month ago

Ok now that I've delved more into these libraries, I understand that this is an issue with the available annotations in the schema-kenerator-core library, which is a dependency of this library. I'll close this issue, and maybe raise one in the other project.