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

FEAT: define JSON schema for amplitude model format #30

Merged
merged 18 commits into from
May 27, 2024
Merged

Conversation

redeboer
Copy link
Collaborator

Defined a JSON schema based on the example Lc2ppiK.json while understanding the format. The model is directly evaluated in VSCode — give it a try, by messing up some of the values and hovering over the keys to see their descriptions.

Admittedly, JSON schema has less features than I thought. Particularly, I had hoped to build enums for for instance the function names from the functions that are defined under functions. As far as I understand, that cannot be done dynamically with JSON schema. Still, there are some fancy things you can do, like validating whether spin definitions are valid.

@redeboer redeboer added the 🖱️ DX Improvements to the Developer Experience label May 13, 2024
@redeboer redeboer self-assigned this May 13, 2024
@redeboer
Copy link
Collaborator Author

@IlyaSegal maybe this schema is helpful for #6?

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@mmikhasenko
Copy link
Collaborator

So much fun. Copilot can take use of it, and write parts of the file.

@redeboer
Copy link
Collaborator Author

redeboer commented May 13, 2024

If the schema can validate #6, we can merge it.

schema.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@mmikhasenko mmikhasenko left a comment

Choose a reason for hiding this comment

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

Nice! Do you know if json schemas can be nested? - i has been discussed at HS3 for long time

schema.json Outdated Show resolved Hide resolved
schema.json Outdated Show resolved Hide resolved
schema.json Outdated Show resolved Hide resolved
schema.json Outdated Show resolved Hide resolved
schema.json Show resolved Hide resolved
schema.json Outdated Show resolved Hide resolved
@redeboer
Copy link
Collaborator Author

Nice! Do you know if json schemas can be nested?

Do you mean schema composition? It's essentially already happening through the definitions key, you would then have to extract those definitions to a separate schema.

schema.json Outdated Show resolved Hide resolved
@mmikhasenko
Copy link
Collaborator

good moment to merge?

@redeboer
Copy link
Collaborator Author

good moment to merge?

Just needs a PR approval ;)

Copy link
Collaborator

@IlyaSegal IlyaSegal left a comment

Choose a reason for hiding this comment

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

Very nice:-)

@redeboer redeboer enabled auto-merge (squash) May 22, 2024 07:41
@redeboer
Copy link
Collaborator Author

Just needs a PR approval ;)

@mmikhasenko if you approve this PR, it should merge automatically

@mmikhasenko mmikhasenko self-requested a review May 27, 2024 13:13
@redeboer redeboer merged commit c8aefa4 into main May 27, 2024
3 checks passed
@redeboer redeboer deleted the json-schema branch May 27, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖱️ DX Improvements to the Developer Experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants