-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat: Generate Description from Scaladoc #499
Conversation
cbd639a
to
eb8be52
Compare
489eecd
to
b634519
Compare
b634519
to
8644ecb
Compare
@kailuowang |
Need a schema description?Using runtime-scaladoc-reader, a description can be generated from Scaladoc comments written in the case class. Add the required dependencies and Compiler Plugin to embedScaladoc := true
addCompilerPlugin("com.github.takezoe" %% "runtime-scaladoc-reader" % "1.0.3")
libraryDependencies += "com.github.takezoe" %% "runtime-scaladoc-reader" % "1.0.3" For example, a case class might be written as follows. /**
* @param name e.g. Sunday, Monday, TuesDay...
*/
case class DayOfWeek(name: String) The generated JSON will look like this. {
"DayOfWeek": {
"properties": {
"name": {
"type": "string",
"description": "e.g. Sunday, Monday, TuesDay..."
}
},
"required": [
"name"
]
}
} |
Just want to understand more about the 2 things
|
@kailuowang
Yes, if the user wants to use the Scaladoc embed feature, it is a must. However, if this option is not used, it is not necessary to include it in the dependency.
Yes, I have. The Swagger spec says the following about
|
What puzzles me is that |
@kailuowang |
Do you need a deeper investigation into this issue? |
I think it's worth investigating. Maybe you create a new sbt-test like the
existing `generate-docs`, (maybe name it `generate-docs-from-scala-doc`)
and play with lib deps settings there and see if you even need the
dependency in the target project.
…On Wed, Sep 7, 2022 at 12:02 PM Kazuma Iemura ***@***.***> wrote:
Do you need a deeper investigation into this issue?
—
Reply to this email directly, view it on GitHub
<#499 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAUKOLGODZBEUZH6Q2V6LLV5C4ARANCNFSM6AAAAAAQEVS6NU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Kai
|
@kailuowang
|
Or is |
I see. Sounds like that the lib dependency is needed unless we can tweak the class loader (which might be beneficial anyway see #497). I suggest leaving |
@kailuowang I'm going to bed today. Thank you again. |
@kailuowang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this meticulous PR!
Close #498
As discussed in the issue above, it is a bit risky, but at least in our product, Scaladoc documents and OpenAPI documents have the same scope, so we think it is necessary.