Skip to content

Commit

Permalink
Json schema to provide coding assistance for goss.yaml in IDEs (#793)
Browse files Browse the repository at this point in the history
* Initial addition of goss json schema

Limitations / missing support
- meta
- title
- patterns
- advanced matchers
- templates

* Document using Json schema draft 7

* Document maintaining Json schema

* Json schema support for matching

* Refine Json schema with initial support for matcher illustrated in examples

Full support requires including full matchers grammar into the json-schema

* Refine Json schema with title and meta attributes
  • Loading branch information
gberche-orange authored Dec 25, 2022
1 parent 52e354a commit a157ea3
Show file tree
Hide file tree
Showing 3 changed files with 1,024 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@ curl -H "Accept: application/vnd.goss-rspecish" localhost:8080/healthz

### Manually editing Goss files

Goss files can be manually edited to use:
Goss files can be manually edited to improve readability and expresssiveneess of tests.

A [Json draft 7 schema](https://github.com/json-schema-org/json-schema-spec/blob/draft-07/schema.json) available in [docs/goss-json-schema.yaml](./docs/goss-json-schema.yaml) makes it easier to edit simple goss.yaml files in IDEs, providing usual coding assistance such as inline documentation, completion and static analysis.

For example, to configure the Json schema in JetBrains intellij IDEA, follow [documented instructions](https://www.jetbrains.com/help/idea/json.html#ws_json_schema_add_custom), with arguments such as `schema url=https://raw.githubusercontent.com/goss-org/goss/master/docs/goss-json-schema.yaml`, `schema version=Json schema version 7`, `file path pattern=*/goss.yaml`

In addition, Goss files can also be further manually edited (without full json support) to use:

* [Patterns](https://github.com/goss-org/goss/blob/master/docs/manual.md#patterns)
* [Advanced Matchers](https://github.com/goss-org/goss/blob/master/docs/manual.md#advanced-matchers)
Expand Down
Loading

0 comments on commit a157ea3

Please sign in to comment.