Skip to content

[WIP] Add JSON Structure to XSD conversion - #69

Closed
clemensv with Copilot wants to merge 2 commits into
masterfrom
copilot/convert-json-structure-to-xsd
Closed

[WIP] Add JSON Structure to XSD conversion#69
clemensv with Copilot wants to merge 2 commits into
masterfrom
copilot/convert-json-structure-to-xsd

Conversation

Copilot AI commented Nov 20, 2025

Copy link
Copy Markdown
Contributor
  • Understand the existing patterns from avrotoxsd.py, structuretocsharp.py, and structuretopython.py
  • Create structuretoxsd.py module with JSON Structure to XSD conversion
  • Support all JSON Structure Core primitive types (string, number, boolean, null, binary, int8-128, uint8-128, float/double, decimal, date, datetime, time, duration, uuid, uri, jsonpointer)
  • Support compound types (object, array, set, map, tuple, any, choice)
  • Support JSON Structure-specific features (namespaces, $ref, $extends, abstract types, required/optional properties, annotations)
  • Add CLI command in commands.json for structuretoxsd (s2x)
  • Create tests following the pattern of test_avrotoxsd.py
  • Validate implementation with test cases
Original prompt

This section details on the original issue you should resolve

<issue_title>Add structuretoxsd: JSON Structure to XSD conversion</issue_title>
<issue_description>## Overview
Implement conversion from JSON Structure schemas to XML Schema Definition (XSD).

Requirements

This conversion should:

  1. Lean on the corresponding Avro conversion (avrotoxsd) as precedent for output structure, including use of Jinja templates where applicable
  2. Cover the full breadth of the JSON Structure Core spec as defined in draft-vasters-json-structure-core-00
  3. Follow the patterns established by structuretocsharp and structuretopython, including their continued support for Avro schemas

Implementation Guidance

  • Review avrotize/avrotoxsd.py for output patterns and template usage
  • Review avrotize/structuretocsharp.py and avrotize/structuretopython.py for the JSON Structure handling patterns
  • Ensure all JSON Structure Core types are supported:
    • JSON Primitive Types: string, number, boolean, null
    • Extended Primitive Types: binary, int8-128, uint8-128, float8/float/double, decimal, date, datetime, time, duration, uuid, uri, jsonpointer
    • Compound Types: object, array, set, map, tuple, any, choice (both tagged and inline unions)
  • Support JSON Structure-specific features:
    • Namespaces and definitions
    • Type references ($ref)
    • Extensions ($extends) and add-ins ($offers/$uses)
    • Abstract types
    • Required/optional properties
    • Type annotations (maxLength, precision, scale, contentEncoding, etc.)

References

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
@clemensv

Copy link
Copy Markdown
Owner

@copilot

Additional Requirements

Documentation

The README.md file needs to be updated to include documentation for this new conversion feature, following the pattern established for existing conversions.

Testing

All tests must follow the established testing patterns:

  • For programming language outputs (C#, Java, Python, TypeScript, JavaScript, C++, Go, Rust): Tests must run the embedded tests in the code outputs to verify correctness
  • For schema language outputs (CSV, Protobuf, XSD, GraphQL, etc.): Tests must compare the generated output to a desired output reference (-ref) schema stored in the /test/struct directory

This follows the pattern established for the Avro conversion tests in the repository.

@clemensv

Copy link
Copy Markdown
Owner

Closing duplicate PR for XSD conversion. Keeping the newer PR #96 for this issue.

@clemensv clemensv closed this Nov 20, 2025
@clemensv
clemensv deleted the copilot/convert-json-structure-to-xsd branch November 20, 2025 10:20
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.

Add structuretoxsd: JSON Structure to XSD conversion

2 participants