swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Can i controller schema order with same property?

Open hqsz opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. I have below use case

  1. using replaceWithSchema at configuration
    init {
        SpringDocUtils
            .getConfig()
            .replaceWithSchema(
                UserId::class.java,
                Schema<UserId>().apply {
                    description = "default description"
                    type = "integer"
                }
            )
    }
  • because this type is so widely using, so i want to apply common schema by type
  1. but sometimes i need to override schema because it need more detail description
data class TwoUserIds(
  val userId: UserId,
  @Schema(description = "detail description", type = "integer")
  val otherUserId: UserId
)

but i couldn't find a way to control annotation processing order.

Describe the solution you'd like

  • add some property to control annotation process order (maybe filed name is order?)
  • Alternatively, annotation that having detail scope may impliclity applied later

hqsz avatar Jul 31 '22 14:07 hqsz

I asked same question at springdoc/springdoc-openapi#1757 but they said it is part of swagger-core 🙏

hqsz avatar Jul 31 '22 14:07 hqsz