-
Notifications
You must be signed in to change notification settings - Fork 96
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
Use schema that doesn't come from a file #284
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #284 +/- ##
==========================================
- Coverage 76.58% 73.17% -3.41%
==========================================
Files 24 43 +19
Lines 1892 2837 +945
==========================================
+ Hits 1449 2076 +627
- Misses 354 588 +234
- Partials 89 173 +84 ☔ View full report in Codecov by Sentry. |
Hi, @omissis! Do you think such a feature would be acceptable? I am happy to polish it or to take a different approach if you would like it done differently :) |
@ptodev I am not sure I understand how the change correlates with the need you are exposing here. I would do something like this to handle your case: yq -M '.json_schema' your_config.yaml | go-jsonschema - --package example --output /tmp/your_config_schema.go Probably you're talking about using |
Hi @omissis that's correct, we're looking to use |
I guess that's fine with me then. I'll be merging it once you'll mark this Ready for review. |
97744ab
to
0293bd3
Compare
It is sometimes useful to place the json schema in a file which may also contain other config. For example:
In the above example, we'd only need to give go-jsonschema the config which is under
json_schema
. The way I've been doing it so far is by makingaddFile
a public function. Do you think this is ok?