openapi-client icon indicating copy to clipboard operation
openapi-client copied to clipboard

Generator is lacking sanitization of identifiers

Open elsassph opened this issue 7 years ago • 0 comments

I have a spec with bits like that:

        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/(fo)RegisterUserrequest"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": ""
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],

or

    "(apple)VerifyReceiptWithApplerequest": {
      "title": "(APPLE) Verify Receipt with AppleRequest",
      "example": {
        "exclude-old-transactions": false,
        "password": "",
        "receipt-data": ""
      },
      "type": "object",
      "properties": {
        "exclude-old-transactions": {
          "description": "",
          "example": false,
          "type": "boolean"
        },

Generated code is invalid because of broken identifiers for:

  • types ((fo)RegisterUserrequest),
  • parameters (x-api-key),
  • fields (exclude-old-transactions)

elsassph avatar Jul 06 '18 17:07 elsassph