API FAQ
1. How do I experience new API features?
Section titled “1. How do I experience new API features?”API new features are currently in testing. To try them, install the latest goctl version and enable GOCTL_EXPERIMENTAL:
$ goctl env -w GOCTL_EXPERIMENTAL=onNew features are supported starting from version 1.5.1, including:
- Data type supports array type
- Support Tag Ignore
- Pure numbers are supported by routes, e.g.
/abc/123/ - api resolver migrated from antlr4 to goparser
When enabling new features in 1.5.1, there are some breaking changes to be aware of:
- syntax header is required
For data type usage examples, see Type Declarations • Examples.
2. goctl api generated error: multiple service names defined…
Section titled “2. goctl api generated error: multiple service names defined…”Declares multiple services are not supported in api syntax files such as writing below as unsupported:
service foo { @handler fooPing get /foo/ping}
service bar { @handler barPing get /bar/ping}The highlighted sections foo and bar show an unsupported pattern; only a single service name is allowed:
service foo { @handler fooPing get /foo/ping}
service foo { @handler barPing get /bar/ping}3. goctl api does not support any type
Section titled “3. goctl api does not support any type”Generic and weak types are not supported in api syntax.