Created by: fantavlik
Description of the PR
Fix for https://github.com/OpenAPITools/openapi-generator/issues/2164
The general fix is to handle the case where a composed schema is a single element defining a type.
For example:
allOf/anyOf/oneOf:
- type: string
^ this case is not really model composition but rather defining the type of the model which is equivalent to type: <>
Input:
components:
schemas:
RatType:
anyOf:
- type: string
enum:
- NR
- EUTRA
- WLAN
- VIRTUAL
type: string
Output for Go model_rat_type.go:
package openapi
type RatType string
// List of RatType
const (
NR RatType = "NR"
EUTRA RatType = "EUTRA"
WLAN RatType = "WLAN"
VIRTUAL RatType = "VIRTUAL"
)
@wing328 can you review this if you get a moment as it is a core change? I've tested Go and regenerated the sample files and there are no changes for Go at least, not sure about other languages.
cc: @mroland91 and @goyalnikhil