-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Machine-readable config description #17892
Open
V02460
wants to merge
30
commits into
element-hq:develop
Choose a base branch
from
V02460:schema
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e41a90d
Add basic JSON Schema for Synapse’s configuration
V02460 a547145
Add descriptions and examples
V02460 048b619
Add worker section
V02460 5a299f1
Initial script
V02460 85ac15d
Improve defaults
V02460 6de8466
Add section headers
V02460 5688f0f
Generate documentation from schema
V02460 fb6a876
Add newsfragment
V02460 2dddfdf
Merge branch 'develop' into schema
V02460 9b57816
Fix link to config documentation
V02460 fecddae
Tweak script so it actually runs (perhaps specific to Python 3.10)
reivilibre 6906711
Add errors for missing descriptions
reivilibre 186f43b
Remove 'smart quotes'; use plain ASCII quotes
reivilibre 6de86f2
Add special type name overrides for bytes, duration and size
reivilibre b2672d7
Fix word `avatar` being lost in transcription of schema
reivilibre 1705d7e
Fix some typos and duplicated example/default blocks
reivilibre 7dc3053
Remove duplicate default
reivilibre 4c98384
Fix type of `account_threepid_delegates`
reivilibre cb15ce6
Add 'Reloading cache factors' section back
reivilibre 2c4902a
Re-add description of room complexity
reivilibre c7fbf7b
Fix default config of `ip_range_blacklist`
reivilibre d6eec62
Fix default of `media_store_path`
reivilibre 84a2491
Move schema
V02460 9704afb
Format JSON schema
V02460 122a3b3
Fix typos
V02460 18f9ac8
Add synapse-config.schema.yaml
V02460 f451e23
Add missing descriptions
V02460 e157a0a
Add meta schema
V02460 9fd0a48
Merge branch 'develop' into schema
V02460 2d817dc
Print usage on too many arguments
V02460 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Generate config documentation from JSON Schema file. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4,139 changes: 1,842 additions & 2,297 deletions
4,139
docs/usage/configuration/config_documentation.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://schema.element.io/v1/meta.schema.json", | ||
"$vocabulary": { | ||
"https://json-schema.org/draft/2020-12/vocab/core": true, | ||
"https://json-schema.org/draft/2020-12/vocab/applicator": true, | ||
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true, | ||
"https://json-schema.org/draft/2020-12/vocab/validation": true, | ||
"https://json-schema.org/draft/2020-12/vocab/meta-data": true, | ||
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true, | ||
"https://json-schema.org/draft/2020-12/vocab/content": true, | ||
"https://schema.element.io/v1/vocab/documentation": true | ||
}, | ||
"$ref": "https://json-schema.org/draft/2020-12/schema", | ||
"properties": { | ||
"io.element.type_name": { | ||
"type": "string", | ||
"description": "Human-readable type of a schema that is displayed instead of the standard JSON Schema types like `object` or `integer`. In case the JSON Schema type contains `null`, this information should be presented alongside the human-readable type name.", | ||
"examples": ["duration", "byte size"] | ||
}, | ||
"io.element.post_description": { | ||
"type": "string", | ||
"description": "Additional description of a schema, better suited to be placed less prominently in the generated documentation, e.g., at the end of a section after listings of items and properties.", | ||
"examples": [ | ||
"### Advanced uses\n\nThe spent coffee grounds can be added to compost for improving soil and growing plants." | ||
] | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this PR in a weekly meeting to make sure that this is something we want to do. People are onboard with the benefits 👍
We just have to make sure this implementation is something we want to use and we won't be kicking ourselves months down the line that it's difficult to express constraints, validation, or formatting.