48d7be7eab
The API generator was generating invalid code when types were defined in a main package because the generated Go code was defining in import from it. This commit update the Go generator to panic with a explicit error message if that situation happens. The commit also add a new endpoint to the example with a named types (i.e. no anonymous) to show that the Generator works fine with them. Change-Id: Ieddd89c67048de50516f7ac7787d602660dc4a54
1.5 KiB
1.5 KiB
API Docs
Description:
Version: v0
List of Endpoints
- Documents
Get One (go to full list)
Get one document with the specified version
GET /api/v0/docs/{path}
Path Params:
name | type | elaboration |
---|---|---|
path |
string |
Response body:
{
id: string // UUID formatted as `00000000-0000-0000-0000-000000000000`
date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
pathParam: string
body: string
version: number
}
Update Content (go to full list)
Update the content of the document with the specified path and ID if the last update is before the indicated date
POST /api/v0/docs/{path}
Query Params:
name | type | elaboration |
---|---|---|
id |
string |
UUID formatted as 00000000-0000-0000-0000-000000000000 |
date |
string |
Date timestamp formatted as 2006-01-02T15:00:00Z |
Path Params:
name | type | elaboration |
---|---|---|
path |
string |
Request body:
{
content: string
}
Response body:
{
id: string // UUID formatted as `00000000-0000-0000-0000-000000000000`
date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
pathParam: string
body: string
}