From e49e8ca169c2d0b81fe41c2757e184f06b0c073f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Mon, 7 May 2018 11:53:08 +0200 Subject: [PATCH] Generate 'cwiki' (#351) * Regenerate 'cwiki' * Change default package value for cwiki --- .../languages/ConfluenceWikiCodegen.java | 16 +- .../cwiki/.openapi-generator-ignore | 6 +- .../cwiki/.openapi-generator/VERSION | 2 +- .../documentation/cwiki/confluence-markup.txt | 239 +++++++++++++----- 4 files changed, 188 insertions(+), 75 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java index fb8607618a7..ed5a229ff70 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java @@ -17,11 +17,17 @@ package org.openapitools.codegen.languages; -import org.openapitools.codegen.*; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; + +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.utils.ModelUtils; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; import java.util.HashMap; import java.util.HashSet; @@ -30,7 +36,7 @@ import java.util.Map; public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConfig { private static final String ALL_OPERATIONS = ""; - protected String invokerPackage = "io.swagger.client"; + protected String invokerPackage = "org.openapitools.client"; protected String groupId = "org.openapitools"; protected String artifactId = "openapi-client"; protected String artifactVersion = "1.0.0"; diff --git a/samples/documentation/cwiki/.openapi-generator-ignore b/samples/documentation/cwiki/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/documentation/cwiki/.openapi-generator-ignore +++ b/samples/documentation/cwiki/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/documentation/cwiki/.openapi-generator/VERSION b/samples/documentation/cwiki/.openapi-generator/VERSION index 7fea99011a6..096bf47efe3 100644 --- a/samples/documentation/cwiki/.openapi-generator/VERSION +++ b/samples/documentation/cwiki/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/cwiki/confluence-markup.txt b/samples/documentation/cwiki/confluence-markup.txt index 3f8324efef7..b6a58731b7b 100644 --- a/samples/documentation/cwiki/confluence-markup.txt +++ b/samples/documentation/cwiki/confluence-markup.txt @@ -21,7 +21,7 @@ h2. Endpoints h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |Pet object that needs to be added to the store |(/) | | | + |pet |Pet object that needs to be added to the store |(/) | | | @@ -41,7 +41,8 @@ h2. Endpoints {code:title=Response Schema |collapse=true} { - "description" : "Invalid input" + "description" : "Invalid input", + "content" : { } } {code} ---- @@ -81,7 +82,8 @@ h2. Endpoints {code:title=Response Schema |collapse=true} { - "description" : "Invalid pet value" + "description" : "Invalid pet value", + "content" : { } } {code} ---- @@ -120,10 +122,22 @@ array[Pet] {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } } @@ -139,7 +153,8 @@ array[Pet] {code:title=Response Schema |collapse=true} { - "description" : "Invalid status value" + "description" : "Invalid status value", + "content" : { } } {code} ---- @@ -178,10 +193,22 @@ array[Pet] {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } } @@ -197,7 +224,8 @@ array[Pet] {code:title=Response Schema |collapse=true} { - "description" : "Invalid tag value" + "description" : "Invalid tag value", + "content" : { } } {code} ---- @@ -236,8 +264,17 @@ Pet {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } } } {code} @@ -252,7 +289,8 @@ Pet {code:title=Response Schema |collapse=true} { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } } {code} *Status Code:* 404 @@ -266,7 +304,8 @@ Pet {code:title=Response Schema |collapse=true} { - "description" : "Pet not found" + "description" : "Pet not found", + "content" : { } } {code} ---- @@ -284,7 +323,7 @@ Pet h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |Pet object that needs to be added to the store |(/) | | | + |pet |Pet object that needs to be added to the store |(/) | | | @@ -304,7 +343,8 @@ Pet {code:title=Response Schema |collapse=true} { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } } {code} *Status Code:* 404 @@ -318,7 +358,8 @@ Pet {code:title=Response Schema |collapse=true} { - "description" : "Pet not found" + "description" : "Pet not found", + "content" : { } } {code} *Status Code:* 405 @@ -332,7 +373,8 @@ Pet {code:title=Response Schema |collapse=true} { - "description" : "Validation exception" + "description" : "Validation exception", + "content" : { } } {code} ---- @@ -370,7 +412,8 @@ Pet {code:title=Response Schema |collapse=true} { - "description" : "Invalid input" + "description" : "Invalid input", + "content" : { } } {code} ---- @@ -409,8 +452,12 @@ ApiResponse {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } } } {code} @@ -449,7 +496,8 @@ ApiResponse {code:title=Response Schema |collapse=true} { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } } {code} *Status Code:* 404 @@ -463,7 +511,8 @@ ApiResponse {code:title=Response Schema |collapse=true} { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } {code} ---- @@ -498,11 +547,15 @@ map[String, Integer] {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } } } } @@ -543,8 +596,17 @@ Order {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } } {code} @@ -559,7 +621,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } } {code} *Status Code:* 404 @@ -573,7 +636,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } {code} ---- @@ -591,7 +655,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |order placed for purchasing the pet |(/) | | | + |order |order placed for purchasing the pet |(/) | | | @@ -612,8 +676,17 @@ Order {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } } {code} @@ -628,7 +701,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "Invalid Order" + "description" : "Invalid Order", + "content" : { } } {code} ---- @@ -646,7 +720,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |Created user object |(/) | | | + |user |Created user object |(/) | | | @@ -666,7 +740,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } {code} ---- @@ -684,7 +759,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |List of user object |(/) | | | + |user |List of user object |(/) | | | @@ -704,7 +779,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } {code} ---- @@ -722,7 +798,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |List of user object |(/) | | | + |user |List of user object |(/) | | | @@ -742,7 +818,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } {code} ---- @@ -780,7 +857,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } } {code} *Status Code:* 404 @@ -794,7 +872,8 @@ Order {code:title=Response Schema |collapse=true} { - "description" : "User not found" + "description" : "User not found", + "content" : { } } {code} ---- @@ -811,7 +890,7 @@ Order h4. Parameters h5. Path Parameters ||Name||Description||Required||Default||Pattern|| - |username |The name that needs to be fetched. Use user1 for testing. |(/) | | | + |username |The name that needs to be fetched. Use user1 for testing. |(/) | | | @@ -833,8 +912,17 @@ User {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } } } {code} @@ -849,7 +937,8 @@ User {code:title=Response Schema |collapse=true} { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } } {code} *Status Code:* 404 @@ -863,7 +952,8 @@ User {code:title=Response Schema |collapse=true} { - "description" : "User not found" + "description" : "User not found", + "content" : { } } {code} ---- @@ -904,19 +994,32 @@ String {code:title=Response Schema |collapse=true} { "description" : "successful operation", - "schema" : { - "type" : "string" - }, "headers" : { "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" + "description" : "calls per hour allowed by the user", + "schema" : { + "type" : "integer", + "format" : "int32" + } }, "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" + "description" : "date in UTC when toekn expires", + "schema" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } } } } @@ -932,7 +1035,8 @@ String {code:title=Response Schema |collapse=true} { - "description" : "Invalid username/password supplied" + "description" : "Invalid username/password supplied", + "content" : { } } {code} ---- @@ -966,7 +1070,8 @@ String {code:title=Response Schema |collapse=true} { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } {code} ---- @@ -988,7 +1093,7 @@ String h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |Updated user object |(/) | | | + |user |Updated user object |(/) | | | @@ -1008,7 +1113,8 @@ String {code:title=Response Schema |collapse=true} { - "description" : "Invalid user supplied" + "description" : "Invalid user supplied", + "content" : { } } {code} *Status Code:* 404 @@ -1022,7 +1128,8 @@ String {code:title=Response Schema |collapse=true} { - "description" : "User not found" + "description" : "User not found", + "content" : { } } {code} ----