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

feat: make operationParameter optional within endpoint parameters #102

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

dcroote
Copy link
Contributor

@dcroote dcroote commented Sep 23, 2023

Closes #100

@dcroote dcroote self-assigned this Sep 23, 2023
Copy link
Member

@bbenligiray bbenligiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me on a cursory glance but it would be nice for @metobom to also review

Copy link
Member

@metobom metobom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works as expected with the below OIS.

{
  "apiSpecifications": {
    "components": {
      "securitySchemes": {
        "CoingeckoSecurityScheme1ApiKey": { "in": "query", "name": "x_cg_pro_api_key", "type": "apiKey" }
      }
    },
    "paths": {
      "/{apiPath}": {
        "get": {
          "parameters": [
            { "in": "path", "name": "apiPath" },
            { "in": "query", "name": "vs_currencies" },
            { "in": "query", "name": "ids" }
          ]
        }
      }
    },
    "security": {
      "CoingeckoSecurityScheme1ApiKey": []
    },
    "servers": [{ "url": "https://pro-api.coingecko.com/api/v3"}]
  },
  "endpoints": [
    {
      "fixedOperationParameters": [],
      "name": "feed",
      "operation": { "method": "get", "path": "/{apiPath}" },
      "parameters": [
        { "name": "name", "required": true },
        { "name": "apiPath", "operationParameter": { "in": "path", "name": "apiPath" }, "required": true },
        { "name": "vs_currencies", "operationParameter": { "in": "query", "name": "vs_currencies" }, "required": true },
        { "name": "ids", "operationParameter": {"in": "query", "name": "ids" }, "required": true }
      ],
      "preProcessingSpecifications": [{ "environment": "Node", "value": "...", "timeoutMs": 5000 }],
      "postProcessingSpecifications": [{ "environment": "Node", "value": "...", "timeoutMs": 5000 }],
      "reservedParameters": [
        { "name": "_type", "fixed": "int256" },
        { "name": "_path", "fixed": "value" },
        { "name": "_times", "fixed": "1000000000000000000" }
      ]
    }
  ],
  "oisFormat": "2.1.0",
  "title": "Coingecko",
  "version": "1.0.0"
}

@dcroote dcroote merged commit baaa088 into main Sep 26, 2023
3 checks passed
@dcroote dcroote deleted the dcroote/uncouple-endpoint-operation-pararms branch September 26, 2023 02:52
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.

Allow endpoint parameters to not be mapped to operation parameters
3 participants