elastic / elastic/stream

Produce a JSONSchema for the mock HTTP config.yml files

Open
#169 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
12
Forks
18
Avg merge
10h 32m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.