{"repo":"davidebianchi/gswagger","free":true,"listed":false,"github":"https://github.com/davidebianchi/gswagger","clone":"git clone https://github.com/davidebianchi/gswagger.git","description":"Generate an openapi spec dynamically based on the types used to handle request and response","language":"Go","stars":37,"topics":["swagger","openapi","gorilla-mux","oas3","echo","fiber"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"[![Build Status][github-actions-svg]][github-actions] [![Go Report Card][go-report-card]][go-report-card-link] [![GoDoc][godoc-svg]][godoc-link] gswagger Generate an openapi spec dynamically based on the types used to handle request and response. It works with any router, it is simple to add support to your router implementing the apirouter interface. The routers supported out of the box are: - gorilla-mux - fiber - echo This lib uses [kin-openapi] to automatically generate and serve a swagger file. To convert struct to schemas, we use [jsonschema] library. The struct must contains the appropriate struct tags to be inserted in json schema to generate the schema dynamically. It is always possible to add a totally custom swagger schema using [kin-openapi]. Install To use it, install with Usage An example usage of this lib with gorilla mux: This configuration will output the schema shown here. Auto generated path params schema The path params, if not set in schema, are auto generated from the path. The format of the path parameters depends on the router library you are using, as explained below. Gorilla Mux Gorilla Mux supports the path parameters as {someParam} , for example as in /users/{userId} . Here is the example test. The generated oas schema will contains userId , carId and driverId as path params set to string. If only one params is set, you must specify manually all the path params. The generated OAS for this test case is visible here. Fiber Fiber supports the path par","default_branch":null,"files":null,"tree":[],"storefront":"/r/davidebianchi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/davidebianchi/gswagger/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}