Closed axebelk closed 3 years ago
Can you describe in detail
In my Django app, I have dynamic URLs for example /city/
Can you provide swagger spec
and the generated code about this error
Here is the swagger.json file content, You can try with this. I can't post the generated code as I switched to some other tools. The issue is /enquiries/{id}/ look at the dynamic {id} -> your generated code should allow to send this ID.
{
"swagger":"2.0",
"info":{
"title":"Demo Api Documentation",
"description":"Demo",
"version":"v1"
},
"host":"127.0.0.1:8000",
"schemes":[
"http"
],
"basePath":"/",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"securityDefinitions":{
"basic":{
"type":"apiKey",
"name":"Authorization",
"in":"header"
}
},
"security":[
{
"basic":[
]
}
],
"paths":{
"/enquiries/":{
"get":{
"operationId":"enquiries_list",
"description":"",
"parameters":[
{
"name":"search",
"in":"query",
"description":"A search term.",
"required":false,
"type":"string"
},
{
"name":"page",
"in":"query",
"description":"A page number within the paginated result set.",
"required":false,
"type":"integer"
}
],
"responses":{
"200":{
"description":"",
"schema":{
"required":[
"count",
"results"
],
"type":"object",
"properties":{
"count":{
"type":"integer"
},
"next":{
"type":"string",
"format":"uri",
"x-nullable":true
},
"previous":{
"type":"string",
"format":"uri",
"x-nullable":true
},
"results":{
"type":"array",
"items":{
"$ref":"#/definitions/Enquiry"
}
}
}
}
}
},
"tags":[
"enquiries"
]
},
"parameters":[
]
},
"/enquiries/{id}/":{
"get":{
"operationId":"enquiries_read",
"description":"",
"parameters":[
],
"responses":{
"200":{
"description":"",
"schema":{
"$ref":"#/definitions/Enquiry"
}
}
},
"tags":[
"enquiries"
]
},
"parameters":[
{
"name":"id",
"in":"path",
"description":"A unique integer value identifying this enquiries.",
"required":true,
"type":"integer"
}
]
}
},
"definitions":{
"Enquiry":{
"type":"object",
"properties":{
"id":{
"title":"ID",
"type":"integer",
"readOnly":true
},
"name":{
"title":"Name",
"type":"string",
"x-nullable":true
},
"email":{
"title":"Email",
"type":"string",
"x-nullable":true
},
"address":{
"title":"Address",
"type":"string",
"x-nullable":true
},
"created_at":{
"title":"Created at",
"type":"string",
"format":"date-time",
"x-nullable":true
},
}
}
}
}
@axebelk
in your spec
, the /enquiries/{id}/
request dose not definition id
in params
you can see in example
Hello,
Parameters not working from url for example: "parameters": [{"name": "city_id", "in": "path", "required": true, "type": "int"}]}
Thanks