Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config Option (useDeprecatedOperations): Do not generate deprecated APIs #564

Closed
melloware opened this issue Sep 2, 2022 · 1 comment
Closed

Comments

@melloware
Copy link
Collaborator

melloware commented Sep 2, 2022

You need an OpenAPI file with an API call marked deprecated: true

Here is an example operation with "deprecated": true, I would love an Orval config option useDeprecatedOperations: false to basically not generate any React Query code for any deprecated APIs. It will reduce my TypeScript code and prevent someone from calling deprecated APIs.

 "/submit-re": {
      "post": {
        "tags": [
          "Manifest"
        ],
        "summary": "Deprecated please use /v2/submit-toc-file",
        "operationId": "createPackageFromFiles",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refresh-data",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "deprecated": true,
      }
@melloware melloware changed the title New Config Option: Do not generate deprecated APIs Config Option (useDeprecatedOperations): Do not generate deprecated APIs Sep 3, 2022
@melloware
Copy link
Collaborator Author

works like a charm in production removing my deprecated operations!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant