oliyh / martian

The HTTP abstraction library for Clojure/script, supporting OpenAPI, Swagger, Schema, re-frame and more
MIT License
529 stars 44 forks source link

parameter not found in specific url #142

Closed behrica closed 2 years ago

behrica commented 2 years ago

The explore method does not find hthe parameters of :models-id-version-get

  (def url "https://api.swaggerhub.com/apis/EFSA/fsbio/1.0.0")

  (def m (martian-http/bootstrap-openapi
          url
          {:server-url "https://efsa-ai-prototypes.westeurope.cloudapp.azure.com/efsafsnlpapi/api/1.0.0"}))
  (martian/explore m)
  (martian/explore m :models-id-version-get)

In the spec it looks like this


"/models/{model_id}/{version}" : {
         "get" : {
            "description" : "Returns description of certain version of model",
            "operationId" : "models-id-version-get",
            "parameters" : [
               {
                  "$ref" : "#/components/parameters/model_id"
               },
               {
                  "$ref" : "#/components/parameters/version"
               }
            ],
            "responses" : {
               "200" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "$ref" : "#/components/schemas/model_description"
                        }
                     }
                  },
                  "description" : "Model description was obtained sucessfully."
               }
            }
         }
      },
behrica commented 2 years ago

The referred components are:

{
   "components" : {
      "parameters" : {
         "job_id" : {
            "in" : "path",
            "name" : "job_id",
            "required" : true,
            "schema" : {
               "type" : "string"
            }
         },
         "model_id" : {
            "in" : "path",
            "name" : "model_id",
            "required" : true,
            "schema" : {
               "type" : "string"
            }
         },
         "version" : {
            "in" : "path",
            "name" : "version",
            "required" : true,
            "schema" : {
               "type" : "string"
            }
         }
      },
oliyh commented 2 years ago

Hello,

This should be fixed in 0.1.21-SNAPSHOT. Thanks