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

API endpoint returns internal route when used with OSS SCG #2

Open
gm2552 opened this issue Aug 9, 2022 · 0 comments
Open

API endpoint returns internal route when used with OSS SCG #2

gm2552 opened this issue Aug 9, 2022 · 0 comments

Comments

@gm2552
Copy link
Owner

gm2552 commented Aug 9, 2022

The Open API endpoint of the search and availability apps should return back the gateway's hostname in the "servers" section. Instead, the internal server route (service.namspace) is being returned when being used with the OSS spring cloud gateway. This does not appear to be an issue with the commercial K8s version of the gateway.

This can be observed by hitting the OpenAPI end point and inspecting the servers field. Below is an example:

http://hungryman.perfect300rock.com/api/search/v3/api-docs/

returns:

{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [
    {
      "url": "http://hungryman-search.workloads/api/search/",
      "description": "Generated server url"
    }
  ],
  "paths": {
    "/search": {
      "get": {
        "tags": [
          "search-resource"
        ],
        "operationId": "getAllSearches",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Search"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "search-resource"
        ],
        "operationId": "addSearch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Search"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Search"
                }
              }
            }
          }
        }
      }
    },
    "/search/{id}": {
      "delete": {
        "tags": [
          "search-resource"
        ],
        "operationId": "deleteSearch",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Search": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "startTime": {
            "type": "integer",
            "format": "int64"
          },
          "endTime": {
            "type": "integer",
            "format": "int64"
          },
          "diningTypes": {
            "type": "string"
          },
          "diningNames": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "radius": {
            "type": "integer",
            "format": "int32"
          },
          "continousSearch": {
            "type": "boolean"
          },
          "requestSubject": {
            "type": "string"
          }
        }
      }
    }
  }
}
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