OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.54k stars 6.27k forks source link

[BUG] The generator generates invalid value for the "example" field #5710

Open behrangsa opened 4 years ago

behrangsa commented 4 years ago

Bug Report Checklist

Description

Sometimes, the generated value for "example" fields are wrong.

openapi-generator version

4.2.3

OpenAPI declaration file content or url
openapi: "3.0.0"

info:
  title: Test
  version: 1.0.0

paths:
  /test:
    post:
      summary: A simple endpoint.
      description: A more detailed explanation of our simple endpoint.
      parameters:
      - in: header
        name: X-Custom
        required: true
        schema:
          $ref: '#/components/schemas/Custom'
      responses:
        '200':
          description: OK

components:
  schemas:
    Custom:
      description: Some description.
      type: string
      format: fubar
      pattern: '^(foo|bar|baz)+$'
      example: foofoobazbarfoo
Command line used for generation
openapi-generator generate -i sample.yaml -g asciidoc -v
Steps to reproduce
  1. Save the given Open API spec in a file named sample.yaml
  2. Run openapi-generator generate -i sample.yaml -g asciidoc -v
  3. The example field should have the value foofoobazbarfoo but it has xCustom_example:
{
  "licenseUrl" : "http://apache.org/licenses/LICENSE-2.0.html",
  "appVersion" : "1.0.0",
  "generatedYear" : "2020",
  "generatorClass" : "org.openapitools.codegen.languages.AsciidocDocumentationCodegen",
  "openAPI" : {
    "openapi" : "3.0.0",
    "info" : {
      "title" : "Test",
      "version" : "1.0.0"
    },
    "servers" : [ {
      "url" : "/"
    } ],
    "paths" : {
      "/test" : {
        "post" : {
          "summary" : "A simple endpoint.",
          "description" : "A more detailed explanation of our simple endpoint.",
          "parameters" : [ {
            "name" : "X-Custom",
            "in" : "header",
            "required" : true,
            "style" : "simple",
            "explode" : false,
            "schema" : {
              "$ref" : "#/components/schemas/Custom"
            }
          } ],
          "responses" : {
            "200" : {
              "description" : "OK"
            }
          }
        }
      }
    },
    "components" : {
      "schemas" : {
        "Custom" : {
          "pattern" : "^(foo|bar|baz)+$",
          "type" : "string",
          "description" : "Some description.",
          "format" : "fubar",
          "example" : "foofoobazbarfoo"
        }
      }
    }
  },
  "scheme" : "http",
  "modelPackage" : "",
  "groupId" : "org.openapitools",
  "gitHost" : "github.com",
  "licenseInfo" : "All rights reserved",
  "invokerPackage" : "org.openapitools.client",
  "apiFolder" : "",
  "generateApis" : true,
  "generateModelDocs" : true,
  "generateModelTests" : true,
  "basePathWithoutHost" : "",
  "generateApiTests" : true,
  "lambda" : {
    "lowercase" : { },
    "uppercase" : { },
    "titlecase" : { },
    "camelcase" : { },
    "indented" : { },
    "indented_8" : { },
    "indented_12" : { },
    "indented_16" : { }
  },
  "generateModels" : true,
  "servers" : [ {
    "url" : "/",
    "variables" : [ ]
  } ],
  "infoUrl" : "https://openapi-generator.tech",
  "inputSpec" : "sample.yaml",
  "host" : "localhost",
  "artifactId" : "openapi-client",
  "hideGenerationTimestamp" : true,
  "snippetlink" : { },
  "unescapedAppDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
  "models" : [ ],
  "artifactVersion" : "1.0.0",
  "appName" : "Test",
  "snippetinclude" : { },
  "appDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
  "contextPath" : "",
  "generateApiDocs" : true,
  "generatorVersion" : "4.2.3",
  "releaseNote" : "Minor update",
  "version" : "1.0.0",
  "apiInfo" : {
    "apis" : [ {
      "appVersion" : "1.0.0",
      "generatorClass" : "org.openapitools.codegen.languages.AsciidocDocumentationCodegen",
      "sortParamsByRequiredFlag" : true,
      "groupId" : "org.openapitools",
      "invokerPackage" : "org.openapitools.client",
      "classVarName" : "default",
      "generateModelDocs" : true,
      "hasImport" : true,
      "generateModelTests" : true,
      "strictSpecBehavior" : true,
      "generateApiTests" : true,
      "classFilename" : "DefaultApi",
      "lambda" : {
        "lowercase" : { },
        "uppercase" : { },
        "titlecase" : { },
        "camelcase" : { },
        "indented" : { },
        "indented_8" : { },
        "indented_12" : { },
        "indented_16" : { }
      },
      "generateModels" : true,
      "infoUrl" : "https://openapi-generator.tech",
      "inputSpec" : "sample.yaml",
      "baseName" : "Default",
      "snippetlink" : { },
      "package" : "",
      "imports" : [ {
        "import" : "string",
        "classname" : "string"
      } ],
      "snippetinclude" : { },
      "contextPath" : "",
      "appDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
      "releaseNote" : "Minor update",
      "version" : "1.0.0",
      "specinclude" : { },
      "headerAttributes" : true,
      "importPath" : ".Default",
      "licenseUrl" : "http://apache.org/licenses/LICENSE-2.0.html",
      "generatedYear" : "2020",
      "modelPackage" : "",
      "gitHost" : "github.com",
      "licenseInfo" : "All rights reserved",
      "hasModel" : false,
      "generateApis" : true,
      "basePathWithoutHost" : "",
      "operations" : {
        "classname" : "DefaultApi",
        "operation" : [ {
          "responseHeaders" : [ ],
          "hasAuthMethods" : false,
          "hasConsumes" : false,
          "hasProduces" : false,
          "hasParams" : true,
          "hasOptionalParams" : false,
          "hasRequiredParams" : true,
          "returnTypeIsPrimitive" : false,
          "returnSimpleType" : false,
          "subresourceOperation" : false,
          "isMapContainer" : false,
          "isListContainer" : false,
          "isMultipart" : false,
          "hasMore" : false,
          "isResponseBinary" : false,
          "isResponseFile" : false,
          "hasReference" : false,
          "isRestfulIndex" : false,
          "isRestfulShow" : false,
          "isRestfulCreate" : false,
          "isRestfulUpdate" : false,
          "isRestfulDestroy" : false,
          "isRestful" : false,
          "isDeprecated" : false,
          "isCallbackRequest" : false,
          "path" : "/test",
          "operationId" : "testPost",
          "httpMethod" : "POST",
          "summary" : "A simple endpoint.",
          "unescapedNotes" : "A more detailed explanation of our simple endpoint.",
          "notes" : "A more detailed explanation of our simple endpoint.",
          "baseName" : "Default",
          "servers" : [ ],
          "allParams" : [ {
            "isFormParam" : false,
            "isQueryParam" : false,
            "isPathParam" : false,
            "isHeaderParam" : true,
            "isCookieParam" : false,
            "isBodyParam" : false,
            "hasMore" : false,
            "isContainer" : false,
            "secondaryParam" : false,
            "isCollectionFormatMulti" : false,
            "isPrimitiveType" : true,
            "isModel" : false,
            "isExplode" : false,
            "baseName" : "X-Custom",
            "paramName" : "xCustom",
            "dataType" : "String",
            "dataFormat" : "fubar",
            "defaultValue" : "null",
            "style" : "simple",
            "example" : "xCustom_example",
            "jsonSchema" : "{\n  \"name\" : \"X-Custom\",\n  \"in\" : \"header\",\n  \"required\" : true,\n  \"style\" : \"simple\",\n  \"explode\" : false,\n  \"schema\" : {\n    \"$ref\" : \"#/components/schemas/Custom\"\n  }\n}",
            "isString" : true,
            "isNumeric" : false,
            "isInteger" : false,
            "isLong" : false,
            "isNumber" : false,
            "isFloat" : false,
            "isDouble" : false,
            "isByteArray" : false,
            "isBinary" : false,
            "isBoolean" : false,
            "isDate" : false,
            "isDateTime" : false,
            "isUuid" : false,
            "isUri" : false,
            "isEmail" : false,
            "isFreeFormObject" : false,
            "isListContainer" : false,
            "isMapContainer" : false,
            "isFile" : false,
            "isEnum" : false,
            "vendorExtensions" : { },
            "hasValidation" : true,
            "isNullable" : false,
            "required" : true,
            "exclusiveMaximum" : false,
            "exclusiveMinimum" : false,
            "pattern" : "/^(foo|bar|baz)+$/",
            "uniqueItems" : false
          } ],
          "bodyParams" : [ ],
          "pathParams" : [ ],
          "queryParams" : [ ],
          "headerParams" : [ {
            "isFormParam" : false,
            "isQueryParam" : false,
            "isPathParam" : false,
            "isHeaderParam" : true,
            "isCookieParam" : false,
            "isBodyParam" : false,
            "hasMore" : false,
            "isContainer" : false,
            "secondaryParam" : false,
            "isCollectionFormatMulti" : false,
            "isPrimitiveType" : true,
            "isModel" : false,
            "isExplode" : false,
            "baseName" : "X-Custom",
            "paramName" : "xCustom",
            "dataType" : "String",
            "dataFormat" : "fubar",
            "defaultValue" : "null",
            "style" : "simple",
            "example" : "xCustom_example",
            "jsonSchema" : "{\n  \"name\" : \"X-Custom\",\n  \"in\" : \"header\",\n  \"required\" : true,\n  \"style\" : \"simple\",\n  \"explode\" : false,\n  \"schema\" : {\n    \"$ref\" : \"#/components/schemas/Custom\"\n  }\n}",
            "isString" : true,
            "isNumeric" : false,
            "isInteger" : false,
            "isLong" : false,
            "isNumber" : false,
            "isFloat" : false,
            "isDouble" : false,
            "isByteArray" : false,
            "isBinary" : false,
            "isBoolean" : false,
            "isDate" : false,
            "isDateTime" : false,
            "isUuid" : false,
            "isUri" : false,
            "isEmail" : false,
            "isFreeFormObject" : false,
            "isListContainer" : false,
            "isMapContainer" : false,
            "isFile" : false,
            "isEnum" : false,
            "vendorExtensions" : { },
            "hasValidation" : true,
            "isNullable" : false,
            "required" : true,
            "exclusiveMaximum" : false,
            "exclusiveMinimum" : false,
            "pattern" : "/^(foo|bar|baz)+$/",
            "uniqueItems" : false
          } ],
          "formParams" : [ ],
          "cookieParams" : [ ],
          "requiredParams" : [ {
            "isFormParam" : false,
            "isQueryParam" : false,
            "isPathParam" : false,
            "isHeaderParam" : true,
            "isCookieParam" : false,
            "isBodyParam" : false,
            "hasMore" : false,
            "isContainer" : false,
            "secondaryParam" : false,
            "isCollectionFormatMulti" : false,
            "isPrimitiveType" : true,
            "isModel" : false,
            "isExplode" : false,
            "baseName" : "X-Custom",
            "paramName" : "xCustom",
            "dataType" : "String",
            "dataFormat" : "fubar",
            "defaultValue" : "null",
            "style" : "simple",
            "example" : "xCustom_example",
            "jsonSchema" : "{\n  \"name\" : \"X-Custom\",\n  \"in\" : \"header\",\n  \"required\" : true,\n  \"style\" : \"simple\",\n  \"explode\" : false,\n  \"schema\" : {\n    \"$ref\" : \"#/components/schemas/Custom\"\n  }\n}",
            "isString" : true,
            "isNumeric" : false,
            "isInteger" : false,
            "isLong" : false,
            "isNumber" : false,
            "isFloat" : false,
            "isDouble" : false,
            "isByteArray" : false,
            "isBinary" : false,
            "isBoolean" : false,
            "isDate" : false,
            "isDateTime" : false,
            "isUuid" : false,
            "isUri" : false,
            "isEmail" : false,
            "isFreeFormObject" : false,
            "isListContainer" : false,
            "isMapContainer" : false,
            "isFile" : false,
            "isEnum" : false,
            "vendorExtensions" : { },
            "hasValidation" : true,
            "isNullable" : false,
            "required" : true,
            "exclusiveMaximum" : false,
            "exclusiveMinimum" : false,
            "pattern" : "/^(foo|bar|baz)+$/",
            "uniqueItems" : false
          } ],
          "optionalParams" : [ ],
          "tags" : [ {
            "name" : "default"
          } ],
          "responses" : [ {
            "headers" : [ ],
            "code" : "200",
            "message" : "OK",
            "hasMore" : false,
            "hasHeaders" : false,
            "isString" : false,
            "isNumeric" : false,
            "isInteger" : false,
            "isLong" : false,
            "isNumber" : false,
            "isFloat" : false,
            "isDouble" : false,
            "isByteArray" : false,
            "isBoolean" : false,
            "isDate" : false,
            "isDateTime" : false,
            "isUuid" : false,
            "isEmail" : false,
            "isModel" : false,
            "isFreeFormObject" : false,
            "isDefault" : true,
            "simpleType" : true,
            "primitiveType" : true,
            "isMapContainer" : false,
            "isListContainer" : false,
            "isBinary" : false,
            "isFile" : false,
            "jsonSchema" : "{\n  \"description\" : \"OK\"\n}",
            "vendorExtensions" : { },
            "uniqueItems" : false,
            "exclusiveMinimum" : false,
            "exclusiveMaximum" : false,
            "wildcard" : false
          } ],
          "callbacks" : [ ],
          "imports" : [ "string" ],
          "vendorExtensions" : { },
          "nickname" : "testPost",
          "operationIdLowerCase" : "testpost",
          "operationIdCamelCase" : "TestPost",
          "operationIdSnakeCase" : "test_post",
          "hasExamples" : false,
          "hasFormParams" : false,
          "restfulShow" : false,
          "restfulIndex" : false,
          "restfulCreate" : false,
          "restfulUpdate" : false,
          "restfulDestroy" : false,
          "restful" : false,
          "hasBodyParam" : false,
          "hasPathParams" : false,
          "hasQueryParams" : false,
          "bodyAllowed" : true,
          "hasHeaderParams" : true,
          "hasCookieParams" : false,
          "hasResponseHeaders" : false
        } ],
        "pathPrefix" : "default"
      },
      "artifactId" : "openapi-client",
      "hideGenerationTimestamp" : true,
      "unescapedAppDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
      "artifactVersion" : "1.0.0",
      "appName" : "Test",
      "generateApiDocs" : true,
      "generatorVersion" : "4.2.3",
      "apiPackage" : "",
      "basePath" : "http://localhost",
      "classname" : "DefaultApi",
      "gitRepoId" : "GIT_REPO_ID",
      "generatedDate" : "2020-03-26T00:16:46.255299+11:00[Australia/Melbourne]",
      "infoEmail" : "team@openapitools.org",
      "appDescriptionWithNewLines" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
      "gitUserId" : "GIT_USER_ID"
    } ]
  },
  "apiPackage" : "",
  "hasServers" : true,
  "basePath" : "http://localhost",
  "specinclude" : { },
  "gitRepoId" : "GIT_REPO_ID",
  "generatedDate" : "2020-03-26T00:16:46.255299+11:00[Australia/Melbourne]",
  "infoEmail" : "team@openapitools.org",
  "appDescriptionWithNewLines" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
  "headerAttributes" : true,
  "gitUserId" : "GIT_USER_ID"
}
Related issues/PRs
Suggest a fix
JRAndreassen commented 4 years ago

I have a similar issue with an additional question... I'm trying to generate automated tests from the examples. The question is how do I get the raw value of the example ? In the model...

I can almost get it...

// ###########################################################################################
{{#openAPI}}
 // #Openapi: {{{openapi}}} 
{{#components}}
 // #components: {{{openapi}}} 
{{#examples}}
 // #examples
{{#Example}}
 // /Example
{{/Example}}

{{#this}}
 // #this: {{{.}}} 
{{/this}}
 // /examples
{{/examples}}
 // /components
{{/components}}
 // /openAPI
{{/openAPI}}

Which gives me

// ###########################################################################################
 // #Openapi: 3.0.0 
 // #components: 3.0.0 
 // #examples

 // #this: {ExFragRule=class Example {
    summary: null
    description: null
    value: <Rule> <Protocol>PING</Protocol> <IPAddress>192.168.253.1</IPAddress> <Port>*</Port> <Condition/> </Rule>
    externalValue: null
    $ref: null
}, ExFragFailoverRules=class Example {
    summary: null
    description: null
    value: <FailOverRules> <Rule> <Protocol>PING</Protocol> <IPAddress>192.168.253.1</IPAddress> <Port>*</Port> <Condition/> </Rule> </FailOverRules>
    externalValue: null
    $ref: null
}, ExFragGateway=class Example {
    summary: null
    description: null
    value: <Gateway> <Name>Spectrum_Port2_GW</Name> <IPFamily>IPv4</IPFamily> <IPAddress>192.168.253.1</IPAddress> <Type>Active</Type> <Weight>1</Weight> <NATPolicy>MASQ</NATPolicy> <FailOverRules> <Rule> <Protocol>PING</Protocol> <IPAddress>192.168.253.1</IPAddress> <Port>*</Port> <Condition/> </Rule> </FailOverRules> </Gateway>
    externalValue: null
    $ref: null
}} 
 // /examples
 // /components
 // /openAPI

But how do I iterate over the list of examples ?

# java -jar openapi-generator-cli.jar generate -g rust --library reqwest -i junk/test_api.yaml -o test
openapi: 3.0.0
info:
  title: Junk
  description: 'RESTful API, minimal'
  version: v1.0
paths:
  '/test':
    get:
      operationId: APIGet
      summary:  Server Configurations Settings
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
servers:
  - url: '{scheme}://127.0.0.1:/api'
    variables:
      scheme:
        enum:
          - 'http'
          - 'https'
        default: https
        description: Default to HTTPS
      port:
        default: '8080'
  - url: 'http://127.0.0.1:8080'
components:
  schemas:
#  ----------------------------------------------------
#  --------------    Type definitions    --------------
#  ----------------------------------------------------
#    $ref: '#/components/schemas/TypeUSHORT'
    TypeUSHORT:
      type: integer
      format: int32
      minimum: 0
      maximum: 65535
#    $ref: '#/components/schemas/TypeEnumModeActive'
    TypeEnumModeActive:
      default: Active
      enum:
        - Active
        - Backup
#    $ref: '#/components/schemas/TypeIPAddress'
    TypeIPAddress:
      type: string
      pattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'
      maximum: 15
      description: Assign an IP address to the wireless network. Note, Applicable only if Client Traffic is selected as 'Separate Zone'..
#   $ref: '#/components/schemas/TypeRouteWeight'
    TypeRouteWeight:
      type: integer
      format: int32
      minimum: 0
      maximum: 256
      default: 1
      nullable: true
      description: 'Weight which determines how much traffic will pass through a particular link relative to the other link.'
#    $ref: '#/components/schemas/TypeEnumActivationAction'
    TypeEnumActivationAction:
      default: InheritWeight
      enum:
        - InheritWeight
        - UseCustomWeight
#    $ref: '#/components/schemas/TypeEnumIPFamily'
    TypeEnumIPFamily:
      default: IPv4
      enum:
        - IPv4
        - IPv6
#    $ref: '#/components/schemas/TypeString50'
    TypeString50:
      type: string
      maxLength: 50
      nullable: true
#    $ref: '#/components/schemas/TypeIdentifier10'
    TypeIdentifier10:
      type: string
      pattern: '^[^,]*$'
      maxLength: 10
      nullable: false
      description: '10 character Identifier Character not allowed, Comma (,)'
#    $ref: '#/components/schemas/TypeUserID'

#  ----------------------------------------------------
#  ------------   Structure definitions    ------------
#  ----------------------------------------------------
    TimeEntry:
      title: Time Entry
      type: object
      properties:
        Time:
          type: string
          description: Time entry
      #example:
      #  summary:  example
      #  $ref: '#/components/examples/'
#    $ref: '#/components/schemas/TimeArray'
    TimeArray:
      title: Time Entry
      type: array
      items:
        $ref: '#/components/schemas/TimeEntry'
      #example:
      #  summary:  example
      #  $ref: '#/components/examples/'
    Gateway:
      description: Gateway Descriptor
      type: object
      properties:
        Name:
          $ref: '#/components/schemas/TypeIdentifier10'
          description: Name for LAG interface. Character not allowed, Comma (,)
        IPFamily:
          $ref: '#/components/schemas/TypeEnumIPFamily'
        IPAddress:
          $ref: '#/components/schemas/TypeIPAddress'
          nullable: true
          description: Used to set IPv4 address for interface in IPv4 configuration. Datatype is 'IPADDRESS'. Maximum characters allowed are 15.
        Type:
          $ref: '#/components/schemas/TypeEnumModeActive'
        Weight:
          $ref: '#/components/schemas/TypeRouteWeight'
        ActivateGatewayOnFailureOf:
          type: string
          nullable: false
          description: "Gateway Activation Condition: Any/All/{GWName}/Manual or Custom."
        ActionOnActivation:
          $ref: '#/components/schemas/TypeEnumActivationAction'
        ActionOnFailback:
          enum:
            - ServeNewConnections
            - ServeAllConnections
          default: ServeAllConnections
          description: "action for existing and new connections after failback. 1 - Serves all connections through the restored gateway. This interrupts existing connection"
        CustomWeight:
          $ref: '#/components/schemas/TypeRouteWeight'
          description: "Use this tag only when <ActionOnActivation>has value 'UseCustomWeight'"
        NATPolicy:
          $ref: '#/components/schemas/TypeIdentifier10'
          description: "Name of NAT Policy interface. Character not allowed, Comma (,)"
        FailOverRules:
          type: array
          items:
            $ref: '#/components/schemas/GWFailOverRule'
      example:
        summary: Failover Rule example
        $ref: '#/components/examples/ExFragGateway'

    FailOverRules:
      description: Gateway Failover rules Descriptor
      type: object
      properties:
        GatewayName:
          $ref: '#/components/schemas/TypeString50'
        IPFamily:
          $ref: '#/components/schemas/TypeEnumIPFamily'
        Rule:
          type: array
          items:
            $ref: '#/components/schemas/GWFailOverRule'
    GWFailOverRule:
      description: Gateway Failover rule
      type: object
      properties:
        Protocol:
          nullable: true
          enum:
            - PING
            - TCP
          default: PING
          description: "action for existing and new connections after failback. 1 - Serves all connections through the restored gateway. This interrupts existing connection"
        IPAddress:
          $ref: '#/components/schemas/TypeIPAddress'
          nullable: false
          description: "Used to set IPv4 address for interface in IPv4 configuration. Datatype is 'IPADDRESS'. Maximum characters allowed are 15."
          # ip
          Port:
            nullable: true
            $ref: '#/components/schemas/TypeUSHORT'
          Condition:
            enum:
              - AND
              - OR
            default: OR
            description: "Rule order matters as this condition will apply on next rule -->"
      example:
        summary: Failover Rule example
        $ref: '#/components/examples/ExFragRule'

  examples:
      ExFragRule:
        value: <Rule>
            <Protocol>PING</Protocol>
            <IPAddress>192.168.253.1</IPAddress>
            <Port>*</Port>
            <Condition/>
          </Rule>
      ExFragFailoverRules:
        value: <FailOverRules>
            <Rule>
              <Protocol>PING</Protocol>
              <IPAddress>192.168.253.1</IPAddress>
              <Port>*</Port>
              <Condition/>
            </Rule>
          </FailOverRules>
      ExFragGateway:
        value: <Gateway>
            <Name>Spectrum_Port2_GW</Name>
            <IPFamily>IPv4</IPFamily>
            <IPAddress>192.168.253.1</IPAddress>
            <Type>Active</Type>
            <Weight>1</Weight>
            <NATPolicy>MASQ</NATPolicy>
            <FailOverRules>
              <Rule>
                <Protocol>PING</Protocol>
                <IPAddress>192.168.253.1</IPAddress>
                <Port>*</Port>
                <Condition/>
              </Rule>
            </FailOverRules>
          </Gateway>
  securitySchemes:
    basic:
      type: http
      scheme: basic
  responses:
    Unauthorized:
      description: Authentication Failure.
      content:
        'application/xml':
          examples:
            def:
              value: <?xml version="1.0" encoding="UTF-8"?>
                <Response>
                  <Login>
                    <status>Authentication Failure</status>
                  </Login>
                </Response>
security:
  - basic: []