Date of slack thread: 5/31/24
Anonymous: If I create a dynamic config with a defined schema, is there a way for me to pull that schema in order to generate types that match the schema in my application?
Anonymous: I’d like to avoid needing to manually manage things. I don’t think there’s currently a way to define JSON schemas via the Statsig API, or else we could maybe define it on our end and push it to Statsig.
Brian (Statsig): Hi <@U074LJMJF44>, to answer your questions separately:
is there a way … to generate types that match the schema in my application? We support JSON Schema in our console, so if you use a JSON Schema validator in your own application, you could reuse it that way. Let me know if I’m misunderstanding here.
… a way to define JSON schemas via the Statsig API We actually do support this use case - you can send a
POST
orPATCH
request to respectively fully- or partially-update a dynamic config, and includeschema
orschemaJson5
in your request to update the config’s schema. Let me know if this answers your questions! https://docs.statsig.com/console-api/dynamic_configs#patch-/dynamic_configs/-dynamic_config_id-