Skip to content

Commit 1a8dcd1

Browse files
authored
Update README.md
1 parent 15c6d36 commit 1a8dcd1

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
11
# label-studio-client-generator
22

3-
## Development
3+
## How to Contribute
4+
1. Create a new or modify [YAML OpenAPI spec](https://swagger.io/docs/specification/about/) for Label Studio endpoints.
5+
For example, `./fern/openapi/resources/comments.yaml`:
6+
```yaml
7+
paths:
8+
/api/comments:
9+
get: ...
10+
post: ...
11+
components:
12+
schemas:
13+
Comments: ...
14+
requestBodies:
15+
api_comments_create: ...
16+
```
17+
- `paths` : contain API path
18+
- `components` (optional): components to reuse in `responses`
19+
- `requestBodies` (optional): request bodies specification to reuse in requests’ `requestBody`
20+
2. Add [`$ref` references](https://swagger.io/docs/specification/using-ref/) in `overrides.yaml`:
21+
```yaml
22+
paths:
23+
/api/comments/:
24+
get:
25+
$ref: "./resources/comments.yaml#/paths/~1api~1comments/get"
26+
x-fern-sdk-group-name: comments
27+
x-fern-sdk-method-name: list
28+
x-fern-audiences:
29+
- public
30+
post:
31+
$ref: "./resources/comments.yaml#/paths/~1api~1comments/post"
32+
x-fern-sdk-group-name: comments
33+
x-fern-sdk-method-name: create
34+
x-fern-audiences:
35+
- public
36+
```
37+
this will define the public methods called `client.comments.list()` and `client.comments.create()`. Read more about [Fern's OpenAPI extensions](https://buildwithfern.com/learn/api-definition/openapi/extensions)
38+
3. Create a PR in `label-studio-client-generator` using [Follow-Merge workflow](https://www.notion.so/214a17976c254100a4c261ec800cf3e8?pvs=21). For example, push a branch called `fb-PRJ-123-update-comments-api`
39+
4. Ensure PR is created in `label-studio-sdk` and Label Studio repo
40+
41+
<aside>
42+
⚠️ Note: Follow-Merge automation is in progress. Until then, do it manually:
43+
1. In `label-studio-client-generator` , perform Actions > Use workflow from [your PR branch] > Run workflow
44+
2. Check the branches generated in `label-studio-sdk` repo and Label Studio repo.
45+
46+
</aside>
47+
48+
5. Update added endpoints in Django code.
49+
6. Add integration tests with newly added functions in LS: `https://github.com/HumanSignal/label-studio/tree/develop/label_studio/tests/sdk`
50+
451

552
### Create openapi.yaml
653

0 commit comments

Comments
 (0)