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

import openapi: fix when missing operation id in spec #102

Merged
merged 1 commit into from
Mar 7, 2019

Conversation

eguzki
Copy link
Member

@eguzki eguzki commented Mar 6, 2019

in OAS 2.0, when there is no operation_id attribute, i.e.

....
"paths": {
    "/products": {
      "get": {
        "summary": "Product Types",
        "description": "The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.",
        "parameters": [
          {
            "name": "latitude",
            "in": "query",
            "description": "Latitude component of location.",
            "required": true,
            "type": "number",
            "format": "double"
          },
          {
            "name": "longitude",
            "in": "query",
            "description": "Longitude component of location.",
            "required": true,
            "type": "number",
            "format": "double"
          }
        ],
        "tags": [
          "Products"
        ],
        "responses": {
          "200": {
            "description": "An array of products",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product"
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
....

method names are computed:

"#{operation[:verb]}#{operation[:path].tr('/{}', '')}"

@eguzki eguzki force-pushed the fix/import-openapi-missing-operation-id branch from 248e910 to 091fc1e Compare March 7, 2019 11:17
@eguzki eguzki requested a review from mikz March 7, 2019 11:17
@eguzki eguzki merged commit 589b014 into master Mar 7, 2019
@eguzki eguzki deleted the fix/import-openapi-missing-operation-id branch March 7, 2019 14:19
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

Successfully merging this pull request may close these issues.

2 participants