Giter Club home page Giter Club logo

Comments (7)

Burgyn avatar Burgyn commented on September 13, 2024

Hi, I'll check it out

from mmlib.swaggerforocelot.

Burgyn avatar Burgyn commented on September 13, 2024

Hi,
I'm afraid I can't reproduce it.
@nkovacic, can you please provide an original swagger.json file? (if it is not secret, of course)
And which version of package you use?

Thanks.

from mmlib.swaggerforocelot.

nkovacic avatar nkovacic commented on September 13, 2024

Updated issue with redacted swagger.json.

from mmlib.swaggerforocelot.

Burgyn avatar Burgyn commented on September 13, 2024

Hi,
unfortunately this library does not currently support parameters (other than {everything} at the end). Therefore, I called this issue an improvement.

It shouldn't be difficult to implement, unfortunately, now I have no time to do it.

Therefore, I leave this issue open if someone wants to create a PR.
Contribution is open.

from mmlib.swaggerforocelot.

jrsanbornjr avatar jrsanbornjr commented on September 13, 2024

I'm experiencing same problem with no double variables in any paths. The swagger.json "info" shows up fine, but only empty paths{} and definitions{}. I have no idea why.

I compared startup and config files in my project to files here in the repo and made sure everything matched. The only difference I can see remaining is that I have four routes defined for ocelot and only one of them with swagger. Does it matter that other routes are defined not using swagger? Does the order make any difference?

from mmlib.swaggerforocelot.

jrsanbornjr avatar jrsanbornjr commented on September 13, 2024

I've gone over and over the configs and startup files in both Ocelot and the web service and I can't find anything that looks different from the examples. I did try removing everything from the Ocelot config but this one service reroute and SwaggerEndpoints entry and that made no difference. Thoughts anyone?

From the gateway, the swagger json looks like this: (modified slightly)

  "swagger": "2.0",      
  "info": {      
    "version": "2",      
    "title": "NexTrip API",      
    "description": "API for creating Metro Transit real-time departure information display"      
  },      
  "paths": {},      
  "definitions": {},      
  "host": "svc.{test}.org"      
}

From the test server directly from the service swagger json:

  "swagger": "2.0",   
  "info": {   
    "version": "2",   
    "title": "NexTrip API",   
    "description": "API for creating Metro Transit real-time departure information display"   
  },   
  "paths": {   
    "/api/routes": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get a list of active Routes for the current service day",   
        "operationId": "GetRoutes",   
        "consumes": [],   
        "produces": [ "application/json" ],    
        "parameters": [],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": {   
              "uniqueItems": false,   
              "type": "array",   
              "items": { "$ref": "#/definitions/Route" }   
            }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" }   
        }   
      }   
    },   
    "/api/providers": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get the full list of regional transit providers",   
        "operationId": "GetProviders",   
        "consumes": [],   
        "produces": [ "application/json" ],   
        "parameters": [],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": {   
              "uniqueItems": false,   
              "type": "array",   
              "items": { "$ref": "#/definitions/Provider" }   
            }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" }   
        }   
      }   
    },   
    "/api/directions/{routeId}": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get two Directions for the given Route, NB/SB or EB/WB",   
        "operationId": "GetDirections",   
        "consumes": [],   
        "produces": [ "application/json" ],   
        "parameters": [   
          {   
            "name": "routeId",   
            "in": "path",   
            "description": "",   
            "required": true,   
            "type": "string"   
          }   
        ],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": {   
              "uniqueItems": false,   
              "type": "array",   
              "items": { "$ref": "#/definitions/Direction" }   
            }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" },   
          "404": {   
            "description": "Not Found",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "400": {   
            "description": "Bad Request",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          }   
        }   
      }   
    },   
    "/api/stops/{routeId}/{directionId}": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get the Timepoint Stops for the requested Route/Direction",   
        "description": "Returns a list of PlaceCodes with descriptions",   
        "operationId": "GetPlaces",   
        "consumes": [],   
        "produces": [ "application/json" ],   
        "parameters": [   
          {   
            "name": "routeId",   
            "in": "path",   
            "description": "Id for the requested route",   
            "required": true,   
            "type": "string"   
          },   
          {   
            "name": "directionId",   
            "in": "path",   
            "description": "Id for the requested direction",   
            "required": true,   
            "type": "integer",   
            "format": "int32"   
          }   
        ],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": {   
              "uniqueItems": false,   
              "type": "array",   
              "items": { "$ref": "#/definitions/Place" }   
            }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" },   
          "404": {   
            "description": "Not Found",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "400": {   
            "description": "Bad Request",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          }   
        }   
      }   
    },   
    "/api/{stopId}": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get a result with stop information and real-time departures",   
        "operationId": "GetDeparturesById",   
        "consumes": [],   
        "produces": [ "application/json" ],   
        "parameters": [   
          {   
            "name": "stopId",   
            "in": "path",   
            "description": "Bus stop id",   
            "required": true,   
            "type": "integer",   
            "format": "int32"   
          }   
        ],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": { "$ref": "#/definitions/NexTripResult" }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" },   
          "404": {   
            "description": "Not Found",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "400": {   
            "description": "Bad Request",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          }   
        }   
      }   
    },   
    "/api/{routeId}/{directionId}/{placeCode}": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get a result with stop information and real-time departures",   
        "operationId": "GetDepartures",   
        "consumes": [],   
        "produces": [ "application/json" ],   
        "parameters": [   
          {   
            "name": "routeId",   
            "in": "path",   
            "description": "Id for the Route",   
            "required": true,   
            "type": "string"   
          },   
          {   
            "name": "directionId",   
            "in": "path",   
            "description": "Id for the Direction",   
            "required": true,   
            "type": "integer",   
            "format": "int32"   
          },   
          {   
            "name": "placeCode",   
            "in": "path",   
            "description": "PlaceCode for the Timepoint stop place name",   
            "required": true,   
            "type": "string"   
          }   
        ],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": { "$ref": "#/definitions/NexTripResult" }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" },   
          "404": {   
            "description": "Not Found",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "400": {   
            "description": "Bad Request",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          }   
        }   
      }   
    },   
    "/api/vehicles/{routeId}": {   
      "get": {   
        "tags": [ "NexTrip" ],   
        "summary": "Get an array of Vehicles in service for a Route",   
        "description": "Enter 0 for all Vehicles",   
        "operationId": "GetVehicles",   
        "consumes": [],   
        "produces": [ "application/json" ],   
        "parameters": [   
          {   
            "name": "routeId",   
            "in": "path",   
            "description": "",   
            "required": true,   
            "type": "string"   
          }   
        ],   
        "responses": {   
          "200": {   
            "description": "Success",   
            "schema": {   
              "uniqueItems": false,   
              "type": "array",   
              "items": { "$ref": "#/definitions/Vehicle" }   
            }   
          },   
          "406": {   
            "description": "Not Acceptable",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "500": { "description": "Server Error" },   
          "404": {   
            "description": "Not Found",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          },   
          "400": {   
            "description": "Bad Request",   
            "schema": { "$ref": "#/definitions/ProblemDetails" }   
          }   
        }   
      }   
    }   
  },   
  "definitions": {   
    "Route": {   
      "type": "object",   
      "properties": {   
        "RouteId": {   
          "type": "string",   
          "readOnly": true   
        },   
        "ProviderId": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "Description": {   
          "type": "string",   
          "readOnly": true   
        },   
        "RouteAbbr": {   
          "type": "string",   
          "readOnly": true   
        }   
      }   
    },   
    "ProblemDetails": {   
      "type": "object",   
      "properties": {   
        "type": { "type": "string" },   
        "title": { "type": "string" },   
        "status": {   
          "format": "int32",   
          "type": "integer"   
        },   
        "detail": { "type": "string" },   
        "instance": { "type": "string" }   
      },   
      "additionalProperties": { "type": "object" }   
    },   
    "Provider": {   
      "type": "object",   
      "properties": {   
        "ProviderId": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "ProviderName": {   
          "type": "string",   
          "readOnly": true   
        }   
      }   
    },   
    "Direction": {   
      "type": "object",   
      "properties": {   
        "DirectionId": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "DirectionName": {   
          "type": "string",   
          "readOnly": true   
        }   
      }   
    },   
    "Place": {   
      "type": "object",   
      "properties": {   
        "PlaceCode": {   
          "type": "string",   
          "readOnly": true   
        },   
        "Description": {   
          "type": "string",   
          "readOnly": true   
        }   
      }   
    },   
    "NexTripResult": {   
      "type": "object",   
      "properties": {   
        "Stop": {   
          "$ref": "#/definitions/Stop",   
          "readOnly": true   
        },   
        "Departures": {   
          "uniqueItems": false,   
          "type": "array",   
          "items": { "$ref": "#/definitions/Departure" },   
          "readOnly": true   
        }   
      }   
    },   
    "Stop": {   
      "type": "object",   
      "properties": {   
        "StopId": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "Latitude": {   
          "format": "double",   
          "type": "number",   
          "readOnly": true   
        },   
        "Longitude": {   
          "format": "double",   
          "type": "number",   
          "readOnly": true   
        },   
        "Description": {   
          "type": "string",   
          "readOnly": true   
        }   
      }   
    },   
    "Departure": {   
      "type": "object",   
      "properties": {   
        "Actual": {   
          "type": "boolean",   
          "readOnly": true   
        },   
        "BlockNumber": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "DepartureText": {   
          "type": "string",   
          "readOnly": true   
        },   
        "DepartureTime": {   
          "format": "date-time",   
          "type": "string",   
          "readOnly": true   
        },   
        "Description": {   
          "type": "string",   
          "readOnly": true   
        },   
        "Gate": {   
          "type": "string",   
          "readOnly": true   
        },   
        "RouteId": {   
          "type": "string",   
          "readOnly": true   
        },   
        "DirectionId": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "DirectionText": {   
          "type": "string",   
          "readOnly": true   
        },   
        "Terminal": {   
          "type": "string",   
          "readOnly": true   
        },   
        "Latitude": {   
          "format": "double",   
          "type": "number",   
          "readOnly": true   
        },   
        "Longitude": {   
          "format": "double",   
          "type": "number",   
          "readOnly": true   
        }   
      }   
    },   
    "Vehicle": {   
      "type": "object",   
      "properties": {   
        "BlockNumber": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "DirectionId": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "LocationTime": {   
          "format": "date-time",   
          "type": "string",   
          "readOnly": true   
        },   
        "RouteId": {   
          "type": "string",   
          "readOnly": true   
        },   
        "Terminal": {   
          "type": "string",   
          "readOnly": true   
        },   
        "Latitude": {   
          "format": "double",   
          "type": "number",   
          "readOnly": true   
        },   
        "Longitude": {   
          "format": "double",   
          "type": "number",   
          "readOnly": true   
        },   
        "Bearing": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "Odometer": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        },   
        "Speed": {   
          "format": "int32",   
          "type": "integer",   
          "readOnly": true   
        }   
      }   
    }   
  }   
}

from mmlib.swaggerforocelot.

Burgyn avatar Burgyn commented on September 13, 2024

Hi @jrsanbornjr
please create new issue and attach ocelot configuration too.
Thanks.

from mmlib.swaggerforocelot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.