mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
Attempt to cleanup API documentation
This commit is contained in:
51
docs/API.md
51
docs/API.md
@@ -56,13 +56,26 @@ To specify a compilation request as a JSON document, post it as the appropriate
|
||||
"userArguments": "Compiler flags",
|
||||
"compilerOptions": {},
|
||||
"filters": {
|
||||
"filter": true
|
||||
"binary": false,
|
||||
"commentOnly": true,
|
||||
"demangle": true,
|
||||
"directives": true,
|
||||
"execute": false,
|
||||
"intel": true,
|
||||
"labels": true,
|
||||
"libraryCode": false,
|
||||
"trim": false
|
||||
},
|
||||
"tools": [],
|
||||
"libraries": []
|
||||
"tools": [
|
||||
{"id":"clangtidytrunk", "args":"-checks=*"}
|
||||
],
|
||||
"libraries": [
|
||||
{"id": "range-v3", "version": "trunk"},
|
||||
{"id": "fmt", "version": "400"}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
The filters are a JSON object with `true`/`false` values. If not supplied,
|
||||
defaults are used. If supplied, the filters are used as-is.
|
||||
@@ -71,6 +84,23 @@ The filters are a JSON object with `true`/`false` values. If not supplied,
|
||||
|
||||
To force a cache bypass, set `bypassCache` in the root of the request to `true`.
|
||||
|
||||
Filters include `binary`, `labels`, `intel`, `directives` and
|
||||
`demangle`, which correspond to the UI buttons on the HTML version.
|
||||
|
||||
With the tools array you can ask CE to execute certain tools available for
|
||||
the current compiler, and also supply arguments for this tool.
|
||||
|
||||
Libraries can be marked to have their directories available when including
|
||||
their header files. The can be listed by supplying the library ids and versions in an array.
|
||||
The id's to supply can be found with the `/api/libraries/<language-id>`
|
||||
|
||||
|
||||
# Non-REST API's
|
||||
|
||||
### `POST /api/compiler/<compiler-id>/compile` - perform a compilation
|
||||
|
||||
This is same endpoint as for compilation using JSON.
|
||||
|
||||
A text compilation request has the source as the body of the post, and uses
|
||||
query parameters to pass the options and filters. Filters are supplied as a
|
||||
comma-separated string. Use the query parameter `filters=XX` to set the
|
||||
@@ -78,17 +108,6 @@ A text compilation request has the source as the body of the post, and uses
|
||||
or `removeFilters` to remove from defaults.
|
||||
Compiler parameters should be passed as `options=-O2` and default to empty.
|
||||
|
||||
Filters include `binary`, `labels`, `intel`, `comments`, `directives` and
|
||||
`demangle`, which correspond to the UI buttons on the HTML version.
|
||||
|
||||
With the tools array you can ask CE to execute certain tools available for
|
||||
the current compiler, and also supply arguments for this tool.
|
||||
For example: ```"tools": [{"id":"clangtidytrunk","args":"-checks=*"}]```
|
||||
to execute clang-tidy with all checks enabled.
|
||||
|
||||
Libraries can be included by supplying the library id and versions in an array, for example:
|
||||
```[{"id": "range-v3", "version": "trunk"}, {"id": "fmt", "version": "400"}]```
|
||||
|
||||
The text request is designed for simplicity for command-line clients like `curl`
|
||||
|
||||
```bash
|
||||
@@ -145,8 +164,6 @@ If JSON is present in the request's `Accept` header, the compilation results
|
||||
}
|
||||
```
|
||||
|
||||
# Not-so-RESTful API's
|
||||
|
||||
### `POST /shortener` - saves given state *forever* to a shortlink and returns the unique id for the link
|
||||
|
||||
The body of this post should be in the format of a [ClientState](https://github.com/mattgodbolt/compiler-explorer/blob/master/lib/clientstate.js)
|
||||
|
||||
Reference in New Issue
Block a user