feat: allow media type overrides (#369)

This commit is contained in:
Ryan Brink
2022-11-05 16:45:06 -04:00
committed by GitHub
parent 2492661f1f
commit a5376cfa82
8 changed files with 201 additions and 11 deletions

View File

@ -165,3 +165,21 @@ get = GetInfo.builder {
}
}
```
## Media Types
By default, Kompendium will set the only media type to "application/json". If you would like to override the media type
for a specific request or response (including errors), you can do so with the `mediaTypes` method
```kotlin
get = GetInfo.builder {
summary("Get user by id")
description("A very neat endpoint!")
response {
mediaTypes("application/xml")
responseCode(HttpStatusCode.OK)
responseType<ExampleResponse>()
description("Will return whether or not the user is real 😱")
}
}
```