module
Version:
v0.4.8
Opens a new window with list of versions in this module.
Published: Jan 17, 2023
License: MIT
Opens a new window with license information.
README
¶
= RAML <--> Go
Parser & serializer for https://raml.org/[RAML] documents to/from concrete Go
types.
.cmd/example/main.go
[source, go]
----
func main() {
res, err := simple.GetRequest("https://raw.githubusercontent.com/raml-org/raml-examples/master/annotations/advanced.raml").
Submit().
GetRawResponse()
check(err)
defer res.Body.Close()
api, err := rparse.ParseApiDoc(res.Body)
check(err)
check(api.WriteRAML(os.Stdout))
}
func check(err error) {
if err != nil {
panic(err)
}
}
----
.example output
[source, sh-session]
----
$ go run v0/cmd/example/main.go
#%RAML 1.0
---
title: Illustrating annotations
mediaType:
- application/json
annotationTypes:
deprecated: nil
experimental: string | nil
feedbackRequested: string?
testHarness:
type: string # This line may be omitted as it's the default type
badge:
clearanceLevel:
properties:
level:
enum: [low, medium, high]
required: true
signature:
pattern: "\\d{3}-\\w{12}"
required: true
/groups:
(experimental):
(feedbackRequested):
/users:
(testHarness): usersTest
(badge): tested.gif
(clearanceLevel):
level: high
signature: 230-ghtwvfrs1itr
get:
(deprecated):
(experimental):
(feedbackRequested): Feedback committed!
responses:
200:
----
Directories
¶
v0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.