-
Notifications
You must be signed in to change notification settings - Fork 41
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
Missing @Example annotation #16
Comments
you can specify it per request like this: get<Unit, Response>(example = Response(...)) {
}
post<Unit, Response, Request>(
exampleRequest = Request(...),
exampleResponse = Response(...)
) { params, request ->
} No mechanism exists yet to provide examples per model globally. |
Yeah, I use examples for methods. I'm not an experienced user of OpenAPI, so I don't know if examples of fields are also usually defined... If yes, I want an opportunity to define them. If no, just remove these "example" fields. |
i will add such a mechanism as it is part of the standard. |
Added @WithExample
class C(val l: @Clamp(0, 10) Long) : Base() {
companion object: ExampleProvider<C> {
override val example: C? = C(5)
}
} or @WithExample(CExampleProvider::class)
class C(val l: @Clamp(0, 10) Long) : Base()
...
object CExampleProvider: ExampleProvider<C> {
override val example: C? = C(5)
} |
|
In the models section, there is a field called "example". Currently it is equal to
null
for all fields in all classes:There should be a way to specify this field. Also, I think if the field is not specified, it shouldn't be presented in the models section.
This is an issue extracted from #12.
The text was updated successfully, but these errors were encountered: