Skip to content

Conversation

@dpezely
Copy link

@dpezely dpezely commented Oct 25, 2025

Where existing behavior renders field names as subtype_0, this PR extracts a name from the relevant SchemaObject, when available.

  • Preserves existing behavior for fall-through cases
  • This scratches an itch from processing W3C's MNX current draft mnx-schema.json
    • e.g., had 60+ instances of subtype_0 through _4 in the resulting .rs file
    • That's as of their commit 0eda842 (latest as of creating this PR)
  • Existing tests pass

@ahl
Copy link
Collaborator

ahl commented Oct 28, 2025

Can you add a test that demonstrates this in action?

@dpezely
Copy link
Author

dpezely commented Oct 30, 2025

Short version: a minimal repo with a canary test that exercises this PR is mnx-canary.

Long version:

  • my JSON schema fu is weak
  • I have some experience modifying existing JSON schema but haven't created one from scratch prior to an attempt at writing a test case for this PR
  • The would-be test's schema.json started as a heavily trimmed version of the W3C mnx-schema.json but was still too verbose
  • potential schema for test
  • However, exercising that schema for purpose of this PR while being idomatic with existing Typify tests would require more time than I have at the moment
  • When time permits, I'll continue that effort but providing what I have now-- for keeping my response somewhat timely

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