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

Custom API for dynamically adding/modifying schemas #151

Closed
JPinkney opened this issue Jun 10, 2019 · 5 comments
Closed

Custom API for dynamically adding/modifying schemas #151

JPinkney opened this issue Jun 10, 2019 · 5 comments

Comments

@JPinkney
Copy link
Contributor

JPinkney commented Jun 10, 2019

This issue is to implement a custom API for dynamically adding and modifying JSON Schemas.

@JPinkney
Copy link
Contributor Author

{
     "title": "CRD's",
     "properties": {
            "CRD Name": {
                  "type": "string",
                  "description": "The name of the CRD"
            }
     }
}

Suppose we have this JSON Schema that a client has added in via our new API.

The client might want to make a request that adds in another property to the schema to make the schema become:

{
     "title": "CRD's",
     "properties": {
            "CRD Name": {
                  "type": "string",
                  "description": "The name of the CRD"
            },
           "CRD Version": {
                  "type": "string",
                  "description": "The version of the CRD"
            }
     }
}

or perhaps the user wants to delete the "CRD Name" property and have:

{
     "title": "CRD's",
     "properties": {
           "CRD Version": {
                  "type": "string",
                  "description": "The version of the CRD"
            }
     }
}

instead.

And all features of the YAML Language server would update accordingly.

@JPinkney
Copy link
Contributor Author

@gorkem Is the above what you had in mind for this new API?

@gorkem
Copy link
Collaborator

gorkem commented Jun 12, 2019

Yes this is the use case. In API terms We need the ability to pass a Schema object and also read the current one.

@JPinkney
Copy link
Contributor Author

This is available as of the 0.7.0 release.

@mkatychev
Copy link

@JPinkney is there an example of how this modification can be done?

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

No branches or pull requests

3 participants