You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix a few issues with go examples generation (#7873)
* Fix a few issues with go examples generation
This fixes a bunch of issues seen when generating go examples, namely
- Numbers aren't casted to the right type
- The time import is missing
- Enums are treated as regular models
* Rebuild more samples
* Use examples properly
* Handle multiple instances in the same doc
* Fix wrong array closure
* Handle model arrays
* Fix file and enum namespace
* Regenerate samples
* Handle maps of complex types
* Handle oneOf
* Fix padding
* Fix enum doc
* Removes links to basic types in arrays
* Remove links to basic types in maps
* Fix enum links
* Minor indent fix
* Handle review comments
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/go/model_doc.mustache
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
{{#models}}{{#model}}# {{classname}}
2
2
3
+
{{^isEnum}}
3
4
## Properties
4
5
5
6
Name | Type | Description | Notes
@@ -12,7 +13,6 @@ Name | Type | Description | Notes
12
13
{{/vars}}
13
14
{{/vendorExtensions.x-is-one-of-interface}}
14
15
15
-
{{^isEnum}}
16
16
## Methods
17
17
18
18
{{^vendorExtensions.x-is-one-of-interface}}
@@ -84,6 +84,13 @@ Convenience method to wrap this instance of {{classname}} in {{{.}}}
84
84
{{/vendorExtensions.x-implements}}
85
85
{{/vendorExtensions.x-is-one-of-interface}}
86
86
{{/isEnum}}
87
+
{{#isEnum}}
88
+
## Enum
89
+
90
+
{{#allowableValues}}{{#enumVars}}
91
+
* `{{name}}` (value: `{{{value}}}`)
92
+
{{/enumVars}}{{/allowableValues}}
93
+
{{/isEnum}}
87
94
88
95
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
0 commit comments