Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-v2): Remove client code generation #1610

Merged
merged 8 commits into from Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
192 changes: 0 additions & 192 deletions docs/src/paradox/05-internals/design/client-api/index.md

This file was deleted.

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

@@@
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 <http://www.gnu.org/licenses/>.
-->

# Generating Client API Code
# Generating Client Test Data

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

```
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/index.md).
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
data:

```
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/index.md
Expand Up @@ -35,6 +35,6 @@ License along with Knora. If not, see <http://www.gnu.org/licenses/>.
- [Profiling Knora](profiling.md)
- [Starting the Knora Stack inside Docker Container](docker-compose.md)
- [Updating Repositories](updating-repositories.md)
- [Generating Client API Code](generating-client-apis.md)
- [Generating Client Test Data](generating-client-test-data.md)

@@@
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 .

<http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> a knora-admin:User ;
knora-admin:username "anything.user01"^^xsd:string ;
Expand Down