Skip to content

fix(downgrader): drop ignored XML names and keep array wrapping - #45

Open
dinwwwh wants to merge 8 commits into
mainfrom
claude/peaceful-maxwell-hhi73l
Open

dinwwwh wants to merge 8 commits into
mainfrom
claude/peaceful-maxwell-hhi73l

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

This PR improves the handling of OpenAPI 3.2's xml.nodeType field during downgrade to 3.1 and 3.0, with better support for element nodes on schema references and proper removal of the name field when it becomes invalid.

Key Changes

  • Enhanced xml.nodeType: 'element' handling for $ref: The converter now follows $ref chains to determine if a referenced schema describes an array, allowing wrapped: true to be correctly applied when an element node wraps a referenced array. This includes handling of schema aliases and loop detection.

  • Proper name field removal: When xml.nodeType is 'text', 'cdata', or 'none' (which have no 3.1 equivalent), the name field is now also removed, since 3.2 ignores it in these contexts while 3.1 would interpret it as an element name.

  • Type union handling in 3.1→3.0 conversion: When converting type unions that include arrays, xml.wrapped is now correctly moved into the array branch of the resulting anyOf, matching the behavior of items which only applies beside type: array.

  • Updated documentation: README clarifications about how element nodes on $ref and type unions are handled, and that name is removed alongside unsupported node types.

Implementation Details

  • Added describesArray() helper to resolve $ref chains and determine if they target arrays, with proper handling of aliases and cycles
  • Modified convertXml() to use the new helper and remove name for unsupported node types
  • Added takeArrayFields() helper in v3.1→3.0 conversion to extract array-specific fields (items, xml.wrapped) into the array branch of type unions
  • Comprehensive test coverage for all new scenarios including $ref chains, aliases, and type unions

https://claude.ai/code/session_01CfwrBWKobQGsT53QRjUbBm

claude added 2 commits October 2, 2026 09:48
… via $ref

- Drop `xml.name` beside `nodeType` `text`, `cdata`, or `none`, which 3.2
  ignores but an older version would use to name an element.
- Treat an explicit `element` on a `$ref` to an array as `wrapped: true`,
  looking the type up along the `$ref` chain, since 3.2 defaults a `$ref`
  to `none` as it does an array.
- When 3.1 → 3.0 splits a type union into `anyOf`, move `xml.wrapped` into
  the array branch, the only place 3.0 applies it. The rest of `xml` stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfwrBWKobQGsT53QRjUbBm
- Hand the array branch the already-fresh `xml` instead of copying it twice.
- Fold the dropped-`name` checks into the existing text/cdata/none rows and
  share the `$ref` fixtures between input and expected output.
- Move the whole-document `$ref` case to spec/components.test.ts, where it
  uses `convertSpec`, and drop comments repeated across files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfwrBWKobQGsT53QRjUbBm
@pullfrog

pullfrog Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

your Pullfrog Router balance is empty, and this repo has no provider key to fall back on, so the agent never ran.

To fix, any one of: add a payment method or top up your Router balance · add a provider API key (GitHub Actions secret or Pullfrog secret) · switch this repo to a free model.

Top up Router → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | 𝕏

@dinwwwh dinwwwh changed the title Handle xml.nodeType element on $ref and improve name removal fix(downgrader): drop ignored XML names and keep array wrapping Oct 2, 2026
claude added 2 commits October 2, 2026 13:13
…ll-hhi73l

# Conflicts:
#	packages/downgrader/README.md
Since $refs inside a schema with an $id resolve against that $id, look up
whether an `element` node's $ref targets an array from the rebased $ref, as
inlineSchema does, rather than from the document root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfwrBWKobQGsT53QRjUbBm
@pullfrog

pullfrog Bot commented Oct 2, 2026

Copy link
Copy Markdown

your Pullfrog Router balance is empty, and this repo has no provider key to fall back on, so the agent never ran.

To fix, any one of: add a payment method or top up your Router balance · add a provider API key (GitHub Actions secret or Pullfrog secret) · switch this repo to a free model.

Top up Router → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | 𝕏

claude added 2 commits October 2, 2026 13:15
Matches how the converters now test for a key, treating one that holds
undefined as missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfwrBWKobQGsT53QRjUbBm
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pullfrog

pullfrog Bot commented Oct 2, 2026

Copy link
Copy Markdown

your Pullfrog Router balance is empty, and this repo has no provider key to fall back on, so the agent never ran.

To fix, any one of: add a payment method or top up your Router balance · add a provider API key (GitHub Actions secret or Pullfrog secret) · switch this repo to a free model.

Top up Router → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | 𝕏

…ll-hhi73l

# Conflicts:
#	packages/downgrader/README.md
@pullfrog

pullfrog Bot commented Oct 2, 2026

Copy link
Copy Markdown

your Pullfrog Router balance is empty, and this repo has no provider key to fall back on, so the agent never ran.

To fix, any one of: add a payment method or top up your Router balance · add a provider API key (GitHub Actions secret or Pullfrog secret) · switch this repo to a free model.

Top up Router → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | 𝕏

@pullfrog

pullfrog Bot commented Oct 2, 2026

Copy link
Copy Markdown

your Pullfrog Router balance is empty, and this repo has no provider key to fall back on, so the agent never ran.

To fix, any one of: add a payment method or top up your Router balance · add a provider API key (GitHub Actions secret or Pullfrog secret) · switch this repo to a free model.

Top up Router → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | 𝕏

dinwwwh commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

The failing pullfrog check isn't caused by this PR. Its log shows action failed: your Pullfrog Router balance is empty ... the agent never ran, so no code from this branch was reviewed or run. It needs a Pullfrog billing top-up or a provider key in the repo settings; nothing in the PR can fix it, and a re-run would fail the same way. CI for this PR (lint_and_typecheck, test_matrix) is running separately on the current head.


Generated by Claude Code

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.

2 participants