Skip to content

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

@gm2552

Description

@gm2552

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"
          }
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions