Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
docs(README): add usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev committed Feb 4, 2022
1 parent bf0d548 commit a16d041
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ go get github.com/neotoolkit/openapi

## Usage
```go
package main

import (
"fmt"
"io/ioutil"
"log"

"github.com/neotoolkit/openapi"
)

func main() {
file, err := ioutil.ReadFile("openapi.yml")
if err != nil {
log.Fatalln(err)
}

oapi, err := openapi.Parse(file)
if err != nil {
log.Fatalln(err)
}

fmt.Println(oapi.OpenAPI)
}

```

## Documentation
Expand Down

0 comments on commit a16d041

Please sign in to comment.