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

Add a --path option to commands like validate #218

Open
jviotti opened this issue Jan 27, 2025 · 7 comments · May be fixed by #220
Open

Add a --path option to commands like validate #218

jviotti opened this issue Jan 27, 2025 · 7 comments · May be fixed by #220
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jviotti
Copy link
Member

jviotti commented Jan 27, 2025

That option would take a JSON Pointer to say: "act on the schema located in this part of the input". It can be a low-hanging fruit to start allowing various of these commands to operate on OpenAPI spec.

@jviotti jviotti added enhancement New feature or request good first issue Good for newcomers labels Jan 27, 2025
@jviotti
Copy link
Member Author

jviotti commented Jan 27, 2025

See #80

@Karan-Palan
Copy link

Hey @jviotti , shall I pick this up?

@jviotti
Copy link
Member Author

jviotti commented Jan 30, 2025

@Karan-Palan Yeah, feel free to go ahead and let me know if you have any questions. The JSON Schema CLI is a thin wrapper around https://github.com/sourcemeta/core (our library that implements JSON, JSON Pointer, etc) and https://github.com/sourcemeta/blaze (our JSON Schema validator), so definitely check out their respective docs!

@Karan-Palan
Copy link

Sure reading the docs

@Karan-Palan
Copy link

Karan-Palan commented Feb 2, 2025

@jviotti , I have created a PR-#220 that might solve this issue. However the checks are failing and I believe that is due to non-formatted code. I have used prettier to format the code, however after inspecting the errors, I found I need to format the code with clang. I got this command from stack overflow and used it, and got this in my terminal:

Image

This might be because I have chromium locally set up as well and might have overrides. This is my first c/c++ contribution hence I'm not aware of dev-tools used in this environment. Could you please help me through this so I can fix it and re-commit my changes after signing them? Also might be a good idea to update the docs about contributing (adding signed commits, branches etc for good practices)

@jviotti
Copy link
Member Author

jviotti commented Feb 3, 2025

Hi @Karan-Palan ,

I have used prettier to format the code

Assuming you mean https://prettier.io, that's a JS specific thing. We indeed use ClangFormat, and with a custom configuration file, so just calling clang-format in the terminal won't do. Note that if you run the project with make, it auto-formats the code the right way if clang-format is available.

This might be because I have chromium locally set up as well and might have overrides. This is my first c/c++ contribution hence I'm not aware of dev-tools used in this environment. Could you please help me through this so I can fix it and re-commit my changes after signing them? Also might be a good idea to update the docs about contributing (adding signed commits, branches etc for good practices)

Not sure what OS you are using, but it's common to install ClangFormat through its PIP package. See how we do it in our CI pipelines: https://github.com/sourcemeta/jsonschema/blob/main/.github/workflows/test.yml#L41

@Karan-Palan
Copy link

I'm using Ubuntu 24 LTS. Thanks for the help, will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants