Skip to content

Commit 5eb797d

Browse files
committed
first API doc
1 parent 19e7003 commit 5eb797d

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@
22

33
This project presents a Flask-based API for validating RO-Crates.
44

5+
## API
6+
7+
#### Request Validation of RO-Crate
8+
9+
#### Get RO-Crate Validation Result
10+
11+
#### Validate RO-Crate Metadata
12+
13+
<details>
14+
<summary><code>POST</code> <code><b>/</b></code> <code>(validates submitted RO-Crate Metadata)</code></summary>
15+
16+
##### Parameters
17+
18+
> | name | type | data type | description |
19+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
20+
> | crate_json | required | string | RO-Crate metadata, stored as a single string |
21+
> | profile_name | optional | string | RO-Crate profile to validate against |
22+
23+
24+
##### Responses
25+
26+
> | http code | content-type | response |
27+
> |---------------|-----------------------------------|---------------------------------------------------------------------|
28+
> | `200` | `application/json` | `Successful Validation` |
29+
> | `422` | `application/json` | `Error: Details of Validation Error` |
30+
31+
##### Example cURL
32+
33+
> ```javascript
34+
> curl -X 'POST' \
35+
> 'http://localhost:5001/v1/ro_crates/validate_metadata' \
36+
> -H 'accept: application/json' \
37+
> -H 'Content-Type: application/json' \
38+
> -d '{
39+
> "crate_json": "{'\''test1'\'':'\''test2'\''}"
40+
> }'
41+
> ```
42+
43+
</details>
44+
45+
46+
547
## Project Structure
648
749
```

0 commit comments

Comments
 (0)