-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NO-JIRA: Add generate Open API script (#697)
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Scripts | ||
|
||
## General guidelines | ||
|
||
Scripts in this folder are meant to be run from the repository base folder. Example: | ||
|
||
```bash | ||
./scripts/generate_openapi.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
OPENAPI_YML_PATH="apps/opik-backend/target/openapi.yaml" | ||
|
||
# Generate openapi.yaml | ||
cd apps/opik-backend | ||
mvn compile swagger:resolve | ||
cd - | ||
|
||
# Copy openapi.yaml for Fern generation | ||
cp $OPENAPI_YML_PATH sdks/python/code_generation/fern/openapi/ | ||
|
||
# Generate Python SDK with Fern from copied openapi.yaml | ||
cd sdks/python/code_generation | ||
fern generate | ||
cd - | ||
|
||
# Format Python code | ||
cd sdks/python | ||
pre-commit run --all-files | ||
cd - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters