Skip to content


Browse files Browse the repository at this point in the history
feat(api-v2): Remove client code generation (#1610)
  • Loading branch information
Benjamin Geer committed Feb 28, 2020
1 parent 73a0afe commit 6977ab3
Show file tree
Hide file tree
Showing 48 changed files with 2,119 additions and 8,898 deletions.
192 changes: 0 additions & 192 deletions docs/src/paradox/05-internals/design/client-api/

This file was deleted.

1 change: 0 additions & 1 deletion docs/src/paradox/05-internals/design/
Expand Up @@ -27,6 +27,5 @@ License along with Knora. If not, see <>.
- [API v1 Design](api-v1/
- [API v2 Design](api-v2/
- [Admin API Design](api-admin/
- [Client API Code Generation Framework](client-api/

Expand Up @@ -17,24 +17,30 @@ You should have received a copy of the GNU Affero General Public
License along with Knora. If not, see <>.

# Generating Client API Code
# Generating Client Test Data

The following route returns a Zip file containing generated client API
code for the specified target:

HTTP GET to http://host/clientapi/TARGET
## Requirements

Generate test requests and responses for Knora's routes, to be used in testing
client code without the need for a running Knora instance.

## Implementation

Currently the only supported `TARGET` is `typescript`. For documentation
on defining client APIs, see
@ref:[Client API Code Generation Framework](../design/client-api/
A class for each Knora API extends the `ClientApi` trait.
A `ClientApi` contains one or more `KnoraRoute` implementations that extend
`ClientEndpoint`. Each endpoint provides functions that return generated
client test data.

To check whether the generated TypeScript code compiles, without actually
integrating it into `knora-api-js-lib`, use:
The route `ClientApiRoute` returns a Zip file containing generated test data.
returning source code in a Zip file.

## Usage

The following route returns a Zip file containing generated client test

HTTP GET to http://host/clientapi/typescript?mock=true
HTTP GET to http://host/clientapitest

This adds mock TypeScript library dependencies.
2 changes: 1 addition & 1 deletion docs/src/paradox/05-internals/development/
Expand Up @@ -35,6 +35,6 @@ License along with Knora. If not, see <>.
- [Profiling Knora](
- [Starting the Knora Stack inside Docker Container](
- [Updating Repositories](
- [Generating Client API Code](
- [Generating Client Test Data](

4 changes: 3 additions & 1 deletion webapi/_test_data/all_data/admin-data.ttl
Expand Up @@ -392,7 +392,9 @@ Die Internetpublikation macht das digitalisierte Korpus dieser Frühdrucke durc
knora-admin:projectLongname "Anything Project"^^xsd:string ;
knora-admin:projectDescription "Anything Project"^^xsd:string ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean ;
knora-admin:projectKeyword "things"^^xsd:string,
"arbitrary test data"^^xsd:string .

<> a knora-admin:User ;
knora-admin:username "anything.user01"^^xsd:string ;
Expand Down

0 comments on commit 6977ab3

Please sign in to comment.