Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,10 @@ cython_debug/
# PyPI configuration file
.pypirc

.envrc
.envrc

private

# build dir contains the cloned specs
# from which we generate the pydantic classes
build
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
# Pydantic EDA

**WIP!**

Pydantic models for EDA OpenAPI spec. Models are generated for the EDA Core API as well as for the apps shipped with EDA Playground at the time of the generation.

## Usage

## Generation

Store Github auth token in a `GH_AUTH_TOKEN` environment variable. For example, with `gh` cli:
Install dev dependencies:

```
export GH_AUTH_TOKEN=$(gh auth token)
uv sync --all-groups
```

Install dev dependencies:
Generate models for a specific version of the openapi repo (git ref):

```
uv add --dev 'datamodel-code-generator[http]' rich ruff httpx
python gen_models.py --version v25.4.1
```

Generate models for a specific version of openapi repo:
The generation script clones the eda-labs/openapi repo at the provided ref and generated models from there.

```
python gen_models.py --version v24.12.1
```
## Modifications

The generation script transforms all schema objects in the source openapi files by removing `com.nokia.eda.<name>.<version>`, as DMCG project has issues with treating schema nodes with dots in their names as module-based schemas. Therefore, the original schema nodes undergo that mutation by the script.

## Versions

The following table matches the project version with the version of the EDA delivery from which the models were generated.

| pydantic_eda | EDA release |
| ------------ | ----------- |
| 0.3.0 | 25.4.1 |
104 changes: 0 additions & 104 deletions cached_specs.json

This file was deleted.

Loading