LinksForIsrael icon indicating copy to clipboard operation
LinksForIsrael copied to clipboard

Compile and enforce links JSON schema

Open ohadschn opened this issue 2 years ago • 3 comments

For example, for each JSON type (category and subcategory): name - mandatory, English only, no spaces shortDescription - mandatory, single line displayName - non empty string etc.

That way we can avoid empty display names, bad initiative keys, etc. Can be easily enforced in PR build

There are several steps to this work item:

  1. Map all JSON fields (everything we ask in the form and/or used in the code) - specifically which are mandatory.
  2. Create JSON schema (can be easily done e.g. https://www.liquid-technologies.com/online-json-to-schema-converter)
  3. Complete all missing fields in current initiatives - this is a CONTENT task
  4. Enforce the schema in the PR build (very simple DevOps task)

In addition to PR validation, we can use this schema as our single source of truth:

  1. Generate new_initiative.yml (locally, will need to commit along with each schema change)
  2. Update form in CI/CD (via Google / MS form API)
  3. Use for ChatGPT function calling API

ohadschn avatar Oct 24 '23 23:10 ohadschn

displayName shortDescription description article website url telegram whatsapp tiktok facebook instagram initiativeImage

4tal avatar Oct 26 '23 18:10 4tal

@ohadschn is it completed?

4tal avatar Nov 05 '23 19:11 4tal

No, and we'd need the exact schema in order to implement it. The list you provided above is partial and not detailed enough - for example it doesn't specify what props are required. Ideally we'd want something in this format: https://json-schema.org/understanding-json-schema

ohadschn avatar Nov 06 '23 01:11 ohadschn