Skip to content

Commit dc4ebd5

Browse files
authored
Enhance README advice on OpenAPI type usage
Clarify the importance of using named types in OpenAPI schemas for better code generation.
1 parent bacf96a commit dc4ebd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Here's an example showing more configuration options:
134134

135135
## General advice
136136
* Prefer yaml definitions to json, much easier to read and to hold comments
137-
* As much as possible make sure you put your types in the `#/components/schemas` section of your openapi yaml/json file (use `$ref`!). The same goes for responses, pathItems, and anything else that can be referred to with a `$ref`. Don't use anonymous types, it makes for an ugly experience with generated code.
137+
* As much as possible make sure you put your types in the `#/components/schemas` section of your openapi yaml/json file (use `$ref`!). The same goes for responses, pathItems, and anything else that can be referred to with a `$ref`. Don't use anonymous types, it makes for an ugly experience with generated code (and hinders reuse).
138138
* avoid using complex parameters, use json request bodies instead (Spring Boot for example doesn't have annotation support for many parameter strategies)
139139
* Specify `format: int32` on integers to ensure you end up with `int/integer` types in generated code
140140
* Be sure to specify the properties that are mandatory (using `required:`)

0 commit comments

Comments
 (0)