summaryrefslogtreecommitdiff
path: root/builder/document.go
diff options
context:
space:
mode:
Diffstat (limited to 'builder/document.go')
-rw-r--r--builder/document.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/builder/document.go b/builder/document.go
new file mode 100644
index 0000000..1dbdc7c
--- /dev/null
+++ b/builder/document.go
@@ -0,0 +1,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)
+}