Skip to content
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

fix: support for yaml file references #179

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

johanneswuerbach
Copy link
Contributor

#153 broke the support for yaml references.

This PR fixes it and adds a tests.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@2cee873). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #179   +/-   ##
=======================================
  Coverage        ?   76.16%           
=======================================
  Files           ?       24           
  Lines           ?     1867           
  Branches        ?        0           
=======================================
  Hits            ?     1422           
  Misses          ?      355           
  Partials        ?       90           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fileExt := filepath.Ext(fileName)
if fileExt != ".json" {
return nil, fmt.Errorf("%w: '%s', only json schema files are allowed", ErrUnsupportedRefExtension, fileExt)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The call to g.fileLoader.Load is already checking for supported file extensions https://github.com/omissis/go-jsonschema/blob/main/pkg/schemas/loaders.go#L143-L149, hence it seems unnecessary to perform this check here again.

@omissis
Copy link
Owner

omissis commented Dec 17, 2023

hey @johanneswuerbach , thanks for the PR, I will check it as soon as I can (probably during the xmas holidays) 🙏

@omissis omissis merged commit 94da9c9 into omissis:main Dec 19, 2023
3 checks passed
@johanneswuerbach johanneswuerbach deleted the ext-path branch December 20, 2023 03:11
@johanneswuerbach
Copy link
Contributor Author

@omissis any chance we could get a new release with this PR and the latest main?

@omissis
Copy link
Owner

omissis commented Jan 17, 2024

@johanneswuerbach I guess that could be done :)

@omissis
Copy link
Owner

omissis commented Jan 17, 2024

@johanneswuerbach et voilà, fresh out of the oven -> https://github.com/omissis/go-jsonschema/releases/tag/v0.15.0

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.

None yet

2 participants