Skip to content

Move the OpenAPI emit layer to OpenAPI.jl 1.x and restore the suite - #58

Open
jd-lara wants to merge 6 commits into
psy6from
jd/openapi-1x
Open

Move the OpenAPI emit layer to OpenAPI.jl 1.x and restore the suite#58
jd-lara wants to merge 6 commits into
psy6from
jd/openapi-1x

Conversation

@jd-lara

@jd-lara jd-lara commented Sep 10, 2026

Copy link
Copy Markdown
Member

Moves the OpenAPI emit layer to OpenAPI.jl 1.x and restores the suite on the regenerated packages (SiennaSchemas b49f2b8).

What changed

  • Components are built through a staged accumulator (stage, set_value!, materialize) because the generated structs are immutable; add_component! materializes once every field is staged. Discriminators and ABSENT follow the 1.x runtime.
  • Readers: VSC converter losses build the LossCurve wrapper the schema requires; remote_bus_control_from/to accept the schema's explicit null; enum-dependent unit lookups stage prime_mover_type and operation_cost before the fields whose units depend on them.
  • Switched admittance follows PR Parse BINIT into solved_admittance, rename initial_status to number_engaged #55: number_engaged, solved_admittance, no fixed Y; FixedAdmittance.y and y_increase are the shared ComplexNumber.
  • Tests use the staged API; six assertions now state the intended 1.x behavior (absent optional fields are ABSENT, materialized values are copies, check_required is enforced by decode).
  • The OpenAPI packages resolve from the sibling checkout until they are registered, so CI on remote pins is expected to fail until then.

Test plan

  • julia --project=test test/runtests.jl — 2444 passed, 0 failed, 0 errored

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDkZStcFzebhh9XFpPKRSo

gen_status maps to ONLINE or OFFLINE instead of a boolean.
Same shape as PowerTableDataParser: Staged{T} plus materialize replaces
construct-then-mutate, discriminators and ABSENT follow the 1.x runtime, and the
OpenAPI packages resolve from the sibling checkout. Suite is not yet green.
VSC converter losses build the LossCurve wrapper; remote_bus_control_from/to take the
schema's explicit null; prime_mover_type and operation_cost stage before the fields whose
units depend on them; the staged-builder layer resolves discriminated units and oneOf fields.
Tests use the staged API and assert 1.x semantics.

Suite: 2444 passed.
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.16256% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/openapi/units.jl 87.87% 12 Missing ⚠️
src/openapi/generation.jl 75.00% 5 Missing ⚠️
src/openapi/device_base.jl 92.50% 3 Missing ⚠️
src/openapi/attributes.jl 66.66% 1 Missing ⚠️
src/openapi/dc_branch.jl 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

`("SwitchedAdmittance", :solved_admittance) => :skip` appeared twice in the
same Dict literal, where Julia silently keeps the last; keep the entry under
the BINIT comment that explains it. The six `IC.APIModel` methods behind the
3-arg `get_value` had no callers -- every real call passes a `Staged` -- so
they went with the "or an already-materialized one" claim in the docstring.

Factor the LossCurve nest built identically at three sites into `_loss_curve`,
and trim the staging-order rationale restated at five call sites to pointers
at `_shadow`, which documents it once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant