From a9f99a17d4c1953d79400fcc15aa2392dcfb9c29 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 24 Apr 2020 09:07:15 -0700 Subject: [PATCH] [codegen] change x-oneOf-name to x-one-of-name. Consistency with naming conventions and x-all-of-name (#5820) * change x-oneOf-name to x-one-of-name. * Add code comments * Add code comments --- .../java/org/openapitools/codegen/DefaultCodegen.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 91edad3cd514..82cebbf02245 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1857,7 +1857,13 @@ public String toAnyOfName(List names, ComposedSchema composedSchema) { } /** - * Return the name of the oneOf schema + * Return the name of the oneOf schema. + * + * This name is used to set the value of CodegenProperty.openApiType. + * + * If the 'x-one-of-name' extension is specified in the OAS document, return that value. + * Otherwise, a name is constructed by creating a comma-separated list of all the names + * of the oneOf schemas. * * @param names List of names * @param composedSchema composed schema