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

Add option to specify custom class names for OpenAPI and AsyncAPI schemas #985

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

dkarwacki
Copy link
Contributor

No description provided.

@dkarwacki dkarwacki requested a review from adamw February 3, 2021 10:30
@dkarwacki dkarwacki linked an issue Feb 3, 2021 that may be closed by this pull request
publishOperationId: (Vector[String], Endpoint[_, _, _, _]) => String
subscribeOperationId: (Vector[String], Endpoint[_, _, _, _]) => String,
publishOperationId: (Vector[String], Endpoint[_, _, _, _]) => String,
schemaObjectInfoToNameMapper: SObjectInfo => String = SObjectInfo.defaultToNameMapper
Copy link
Member

Choose a reason for hiding this comment

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

maybe let's use a simpler name - I think just schemaName would be sufficient, the rest is obvious from the type signature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected

@@ -73,6 +73,10 @@ object SchemaType {
case class SObjectInfo(fullName: String, typeParameterShortNames: List[String] = Nil)
object SObjectInfo {
val Unit: SObjectInfo = SObjectInfo(fullName = "Unit")
val defaultToNameMapper: SObjectInfo => String = info => {
Copy link
Member

Choose a reason for hiding this comment

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

this is only used for openapi/asyncapi generation, so I'd keep that code for use only in these modules. Maybe the package object sttp.tapir.docs.apispec would be a good place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected

@adamw
Copy link
Member

adamw commented Feb 3, 2021

Thank you!

@mergify mergify bot deleted the issue/953 branch February 3, 2021 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Any way to use fully-qualified class names for Schemas?
2 participants