Skip to content

Move GeoJSON source schema to correct dir #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 8, 2025

Conversation

mfisher87
Copy link
Member

@mfisher87 mfisher87 commented Jul 7, 2025

Description

Resolves #785 . Supports #754 . Closes #711

This PR adds a new pre-processing step :(

The root problem is that datamodel-codegen expects $ref paths to be relative to the file containing the $ref pointer, but json-schema-to-typescript expects $ref paths to be relative to the root schema.

See: bcherny/json-schema-to-typescript#324

The new pre-processing script expects $ref paths to follow the json-schema-to-typescript rules, and pre-processes those $ref paths to be compatible with datamodel-codegen in a temp dir. 🤮

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

mfisher87 added 2 commits July 7, 2025 10:36
… with $refs

The root problem is that our TS-type-generation tool,
jsonschema-to-typescript, expects $ref paths to be relative to the
schema root directory, while our Python-type-generation tool,
datamodel-codegen, expects $ref paths to be relative to the file
containing the $ref.

To work around this, I'm adding a pre-processing step to the Python type
generation code which converts the paths to look like datamodel-codegen
expects.
Copy link
Contributor

github-actions bot commented Jul 7, 2025

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/relocate-geojson-source-schema

@mfisher87 mfisher87 added the bug Something isn't working label Jul 7, 2025
Copy link
Contributor

github-actions bot commented Jul 7, 2025

Integration tests report: appsharing.space

@mfisher87 mfisher87 enabled auto-merge (squash) July 7, 2025 20:57
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mfisher87 mfisher87 merged commit 8db28fc into geojupyter:main Jul 8, 2025
17 checks passed
@mfisher87 mfisher87 deleted the relocate-geojson-source-schema branch July 8, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source schema geojsonsource.json is not colocated with other source schemas
2 participants