Produce a JSONSchema for the mock HTTP config.yml files

Aperta
#169 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Inizia individuando le struct Go che definiscono i file mock HTTP config.yml e la configurazione CI del repository. Prova l’approccio invopop/jsonschema suggerito con le struct e i relativi tag jsonschema. Il lavoro è completato quando viene generato un JSON Schema da queste struct e salvato nel repository, e CI rileva quando lo schema committato non corrisponde più.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

The goal is to have a JSON Schema definition for the configuration files that describe the mock HTTP endpoints. This will provide hints and validation in IDEs. It would be used like this

# yaml-language-server: $schema=https://server.com/elastic-stream.schema.json
---
rules:
  - path: /api/v1/Foo
    methods: ["POST"

or the IDE could be configured based on file path patterns to apply the schema, such that no yaml-language-server hint is necessary.


Requirements
  • The JSON Schema should be generated from the structs in the code to ensure the schema is always in sync with the code.
  • CI should validate that the schema file in the repo is matches the code.

I have had good experience using https://github.com/invopop/jsonschema to generate schemas from structs that are annotated with jsonschema struct tags. So I would try this path first.

Lingua principale
Go
Stelle
12
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di elastic/stream

Tutte le issue di elastic/stream

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.