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

Custom model schema definition #42

Closed
amirkarimi opened this issue Jan 12, 2016 · 1 comment
Closed

Custom model schema definition #42

amirkarimi opened this issue Jan 12, 2016 · 1 comment

Comments

@amirkarimi
Copy link

When generating model schema for third-party types like org.joda.time.Datetime play-swagger generates the data-type correctly but it won't show up in Model Schema (JSON preview) in Swagger-UI.

Is it possible to define these types in somewhere like swagger.yml.

There are other situation which we need to define our type description manually. For example suppose the following object:

object ProgressStatus {
  type Type = String

  val Done = "done"
  val InPorgress = "inProgress"
}

Which we used like an Enumeration:

case class MyModel(status: ProgressStatus.Type)

I want to define ProgressStatus.Type manually and describe about it's valid values.

@kailuowang
Copy link
Member

Right now play-swagger use run-time reflection to parse classes. For your case, did "string" show up as the data-type for your status?
You might have to override the whole model schema for MyModel generated by play-swagger for in the swagger.yml, and provide another schema for ProgressStatus which then can be referenced by MyModel's schema

Javakky-pxv added a commit to scala-steward/play-swagger that referenced this issue Nov 10, 2023
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

No branches or pull requests

2 participants