Skip to content

Allow relaxing of OAS validation failures via --exclude-path #7343

@bruceharrison1984

Description

@bruceharrison1984

Is your feature request related to a problem? Please describe the problem.

In events where the OAS doesn't fully conform, we should be able to relax validation so generation can proceed. Considering many cases where you are not in a position to fix the underlying OAS, this would provide an escape hatch. In the following example, a path parameter is defined but isn't used, which throws an error:

OpenAPI error #/paths/~1/get/parameters/0/in - Declared path parameter "path" needs to be defined as a path parameter at either the path or operation level

Excluding this path doesn't seem to work, and subsequent command don't run because kiota returns a non-zero exit code after the above error. So the only option left is to just swallow the exit-code so we can continue on

"/": {
  "get": {
    "tags": [
      "StaticResource"
    ],
    "parameters": [
      {
        "name": "path",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    ],
    "responses": {
      "200": {
        "description": "OK"
      }
    }
  }
},

Client library/SDK language

C#

Describe the solution you'd like

I'd like the --exclude-path flag to skip validation on OAS endpoints I don't care to generate anyway, or some kind of CLI flag that ignores OAS validation issues.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions