Skip to content

Commit 08761df

Browse files
committed
move examples into wiki
1 parent 6321a47 commit 08761df

File tree

1 file changed

+2
-75
lines changed

1 file changed

+2
-75
lines changed

README.md

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
JSON API Spec Conformance: **Non Conforming**
44

5+
Go [here](https://github.com/Research-Institute/json-api-dotnet-core/wiki/Request-Examples) to see examples of HTTP requests and responses
6+
57
## Usage
68

79
- Configure the service:
@@ -23,81 +25,6 @@ services.AddJsonApi(config => {
2325
app.UseJsonApi();
2426
```
2527

26-
## Example Requests
27-
28-
### GET TodoItems
29-
30-
Request:
31-
32-
```
33-
curl -X GET
34-
-H "Content-Type: application/vnd.api+json"
35-
"http://localhost:5000/api/v1/todoItems/"
36-
```
37-
38-
Response:
39-
40-
```
41-
{
42-
"links": {
43-
"self": "http://localhost:5000/api/v1/todoItems/"
44-
},
45-
"data": [
46-
{
47-
"type": "todoItems",
48-
"id": "2",
49-
"attributes": {
50-
"name": "Something To Do"
51-
},
52-
"relationships": {
53-
"owner": {
54-
"self": "http://localhost:5000/api/v1/todoItems/2/relationships/owner",
55-
"related": "http://localhost:5000/api/v1/todoItems/2/owner"
56-
}
57-
},
58-
"links": {
59-
"self": "http://localhost:5000/api/v1/todoItems/2"
60-
}
61-
}
62-
]
63-
}
64-
```
65-
66-
### Get People/{id}
67-
Request:
68-
69-
```
70-
curl -X GET
71-
-H "Content-Type: application/vnd.api+json"
72-
"http://localhost:5000/api/v1/people/1"
73-
```
74-
75-
Response:
76-
77-
```
78-
{
79-
"links": {
80-
"self": "http://localhost:5000/api/v1/people/1"
81-
},
82-
"data": {
83-
"type": "people",
84-
"id": "1",
85-
"attributes": {
86-
"name": "Captain Obvious"
87-
},
88-
"relationships": {
89-
"todoItems": {
90-
"self": "http://localhost:5000/api/v1/people/1/relationships/todoItems",
91-
"related": "http://localhost:5000/api/v1/people/1/todoItems"
92-
}
93-
},
94-
"links": {
95-
"self": "http://localhost:5000/api/v1/people/1"
96-
}
97-
}
98-
}
99-
```
100-
10128
## References
10229
[JsonApi Specification](http://jsonapi.org/)
10330

0 commit comments

Comments
 (0)