summaryrefslogtreecommitdiff
path: root/builder/document.go
blob: 1dbdc7ccd85007bb73fe151c64188f752c0b3f60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package builder

import (
	"encoding/json"
)

type Info struct {
	Title   string `json:"title"`
	Version string `json:"version"`
}

type Paths map[string]interface{}

type Document struct {
	Version string `json:"openapi"`
	Info    *Info  `json:"info"`
	Paths   Paths  `json:"paths"`
}

func (document *Document) ToJSON() string {
	bytes, _ := json.MarshalIndent(document, "", "  ")
	return string(bytes)
}