Skip to content

Commit

Permalink
feat: Add openapi markdown documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Oct 23, 2024
1 parent c9971f8 commit d531200
Show file tree
Hide file tree
Showing 4 changed files with 11,964 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ curl -X POST http://localhost:3068/quickstart/transactions -d '{"postings": [{
"timestamp": "2024-10-03T08:10:37.109371Z",
"insertedAt": "2024-10-03T08:10:37.109371Z",
"id": 1,
...
...wiudd
}
]
}
Expand Down Expand Up @@ -204,6 +204,7 @@ Current set of features:

When feature `MOVES_HISTORY` is enabled (= `ON`), the ledger will register any individual funds movements for each account/asset pair.
There is the table schema :

![table schema](./docs/database/_default/diagrams/tables/moves.1degree.png "Moves table")

Column `post_commit_effective_volumes` will be set only if feature `MOVES_HISTORY_POST_COMMIT_EFFECTIVE_VOLUMES` is enabled.
Expand Down Expand Up @@ -400,6 +401,7 @@ This command will :
* generate the client sdk (in [pkg/client](pkg/client))
* fix dependencies
* generate [openapi](openapi.yaml) specification by combining [api versions](./openapi)
* ...

### Run tests

Expand All @@ -412,6 +414,10 @@ Additionally, the flag ```--coverage=true``` can be passed to generate coverage
$ earthly -P +tests --coverage=true # Generated under cover.out
```

## API reference

See [API reference](./docs/api/API.md)

## Terminology

### Bounded source account
Expand Down
8 changes: 8 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ pre-commit:
BUILD +tidy
BUILD +lint
BUILD +openapi
BUILD +openapi-markdown
BUILD +generate
BUILD +generate-client
BUILD +export-docs-events
Expand Down Expand Up @@ -163,6 +164,13 @@ openapi:
RUN yq -oy ./openapi.json > openapi.yaml
SAVE ARTIFACT ./openapi.yaml AS LOCAL ./openapi.yaml

openapi-markdown:
FROM node:20-alpine
RUN npm install -g widdershins
COPY (+openapi/openapi.yaml) .
RUN widdershins openapi.yaml -o README.md --search false --language_tabs 'http:HTTP'
SAVE ARTIFACT README.md AS LOCAL docs/api/API.md

tidy:
FROM +sources
WORKDIR /src
Expand Down
Loading

0 comments on commit d531200

Please sign in to comment.