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

Server - Add a config to define what files should be treated as JSON Schema files #5

Closed
jdesrosiers opened this issue Feb 16, 2024 · 7 comments
Assignees

Comments

@jdesrosiers
Copy link
Collaborator

jdesrosiers commented Feb 16, 2024

The server is hardcoded to identify **/*.schema.json and **/schema.json files as JSON Schema files. This setting would allow you to change that. For example, users should be able to select a directory where the client will look for schemas.

Depends on: #4

@Adity20
Copy link

Adity20 commented Mar 11, 2024

Can I work on this one @jdesrosiers

@Adity20
Copy link

Adity20 commented Mar 11, 2024

My partner and I would like to work on this issue. Please assign. I have created a DM group on slack with my partner to discuss and collaborate as mentioned in the qualification task requirements. Thanks. @jdesrosiers

@nikhilyadav24
Copy link

hey! @jdesrosiers please assign this to me i'll be working with @Adity20

@Adity20
Copy link

Adity20 commented Mar 16, 2024

Hello @jdesrosiers
I performed some steps to complete this task and I want to know if these were the changes you're looking for before making the pull request.

  1. I added a new configuration setting for the schema directory. This will be the directory where the client looks for schema files.
  2. Then I updated the configuration change handler.
  3. Then I implemented the logic of identifying the json schema files.
  4. In the end I handled the errors or a feedback if a specific directory doesn't exist

@Adity20
Copy link

Adity20 commented Mar 16, 2024

We'll have to work on issue #4 to get more out of these changes.

@jdesrosiers
Copy link
Collaborator Author

A few things sound a bit off.

  1. I added a new configuration setting for the schema directory. This will be the directory where the client looks for schema files.

This sounds too focused on directories. I expect something like a list of patterns that files need to match. For example, the default is ["**/*.schema.json", "**/schema.json"] which means any file that ends with .schema.json. If you wanted to use .json extensions and and limit to a the "schemas" directory, you would set the value to ["schemas/**/*.json"].

  1. Then I implemented the logic of identifying the json schema files.

I don't think you actually have to implement the logic for identifying the files. That functionality is built in. You should just need to pass in a new set of patterns. That's my expectation at least, but I could be wrong.

  1. In the end I handled the errors or a feedback if a specific directory doesn't exist

I'm not sure I see a need for error handling. If a pattern includes a directory that doesn't exist, then nothing will match that pattern.

We'll have to work on issue #4 to get more out of these changes.

Another group is working on #4 as part of their task. You'll need to coordinate with them.

@Adity20
Copy link

Adity20 commented Mar 17, 2024

Firstly thanks for clarifying each point with such details @jdesrosiers
I will surely look into all the things you mentioned.
I will shift my direction to patterns rather than focusing on directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment