S
S
Savely2021-03-29 16:40:20
API
Savely, 2021-03-29 16:40:20

How to convert swagger structure?

There are many different swagger structures that describe url parameters in general, everything that usually happens in a swagger.
The task is to write a custom web interface in which there will be user-friendly inputs, then these inputs were collected in the desired json and sent to the desired url.

There are tools that would parse the swagger and provide data that you can work with. For example, from https://petstore3.swagger.io/ the first example gave the following structure:

{
url:"http",
summary: "Put pet",
http_method: "put",
parametrs:
 {
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
 }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2021-03-29
@inoise

On the swagger site itself, you can generate a client library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question