An open API service indexing awesome lists of open source software.

https://github.com/orsinium-labs/openapi

Go package with type definitions for generating OpenAPI documentation.
https://github.com/orsinium-labs/openapi

go golang openapi swagger

Last synced: 5 months ago
JSON representation

Go package with type definitions for generating OpenAPI documentation.

Awesome Lists containing this project

README

          

# openapi

Go package with type definitions for generating [OpenAPI](https://swagger.io/specification/) documentation.

## Installation

```bash
go get github.com/orsinium-labs/openapi
```

## Usage

```go
docs := openapi.OpenAPI{
Version: "3.0.2",
Info: openapi.Info{
Title: "Cool service",
},
Paths: openapi.Paths{
"/echo": openapi.PathItem{
Post: openapi.Operation{
Summary: "Scream into the void",
},
},
},
}
jsonDocs, err := json.Marshal(docs)
```