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

Check json configuration for errors with typed schema #8

Open
mkurkov opened this issue Apr 16, 2024 · 0 comments
Open

Check json configuration for errors with typed schema #8

mkurkov opened this issue Apr 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mkurkov
Copy link
Collaborator

mkurkov commented Apr 16, 2024

Overview

Would be nice to have something like TypedSchema approach for automating loading from json maps to GrowthBook structs.
So from one description we could:

  • generate defstruct field list with defaults
  • generate type
  • generate from_json function that will check field types and constraints

Example:

defmodule GrowthBook.Feature do
  use GrowthBook.TypedSchema
  
  typed_schema [
    id: integer(required: true),
    rules: list(GrowthBook.Feature, default: [])
  ]
end
@mkurkov mkurkov added the enhancement New feature or request label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant