Failed to parse the name with hyphen of definition property on OpenAPI importing.

Ilya Igushev
Kilo Contributor

I populate this OpenAPI content. On select setODLCertificate operation request body input is understood as plain string, not object with string named aaa-cert. When name of property is aaacert it works ok. How to fix this problem?

find_real_file.png

{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "aaa cert rpc api remove dash and other special",
    "contact": {}
  },
  "host": "localhost:8181",
  "basePath": "/",
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/rests/operations/aaa-cert-rpc:setODLCertificate": {
      "post": {
        "description": "The certificate should be generated based on\na certificate request generated from the ctl.jks\nkeystore otherwise the certificate will not be added to ctl keystore",
        "summary": "setODLCertificate",
        "operationId": "setODLCertificate",
        "deprecated": false,
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/setODLCertificateinputTOP"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "headers": {}
          }
        },
        "security": []
      }
    }
  },
  "definitions": {

    "setODLCertificateinputTOP": {
      "title": "setODLCertificateinputTOP",
      "type": "object",
      "properties": {
        "aaa-cert": {
          "type": "string"
        }
      }
    }
  },
  "tags": []
}

 

1 ACCEPTED SOLUTION

miroslav1
Kilo Expert

Seems like Orlando instance is working fine

View solution in original post

3 REPLIES 3

miroslav1
Kilo Expert

I have similar problem. Why does it say it is string not containing anything if it is a json object containing other properties. This happens only with special characters like dash.

miroslav1
Kilo Expert

Seems like Orlando instance is working fine

dougbell
ServiceNow Employee
ServiceNow Employee

In New York the only special character supported in OpenAPI JSON names is the underscore (_).  In Orlando any special character is allowed in a name.