Skip to content

How do I map a schema to an existing kotlin class when generating an openapi server? #1783

Answered by ricker-flow
ricker-flow asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out

components:
  schemas:    
    MyObject:
      type: object
      properties:
        start:
          $ref: "MySpecialClass"
server("mymodel", file("src/main/resources/omymodel-api.yaml")) {
  apiPackageName = "foo.bar.api"
  modelPackageName = "foo.bar.dto"
  useReactive = false
  useAuth = false
  lang = "kotlin"
  importMapping =
    mapOf(
      "MySpecialClass" to "foo.bar.MySpecialClass",
    )
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by altro3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants