Add JSON Schema for Trivia Lists #5565
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!5565
Loading…
Reference in a new issue
No description provided.
Delete branch "patch-86"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the changes
Closes #5301. May be altered pending comments on #5390, and #5897 if it gets merged.
Adds JSON schema for Trivia list author and configuration keys.
Once this is approved and merged, you or I should make a PR against https://github.com/SchemaStore/schemastore as well (see SchemaStore/schemastore#1226)
I'd be happy doing this 👍
Draft (pending): https://github.com/SchemaStore/schemastore/pull/2068
In addition to the review comments:
$schemakey instead of treating it as a questionadditionalProperties: https://json-schema.org/draft/2020-12/json-schema-core.html#section-10.3.2.3@ -0,0 +1,61 @@{This is the default value so it should not need to be specified:
The only valid keys are specified in the schema so we can disallow names not listed here:
I sent the first review a bit too soon - I forgot to review properties in
CONFIGkey...Aside from review comments, you should probably also remove the default values from everything as they're not actually accurate since they depend on whatever the server set those values to. All of the keys simply have no default value, if they're not specified in the YAML file then they're simply not being overridden.
@ -0,0 +1,61 @@{What do you mean by this?
JSON schema url can be specified with a top-level
$schemakey (to be explicit rather than rely on editor's auto-detection). However, Trivia cog will currently reject this as it expects all keys except AUTHOR and CONFIG to be questions.This should probably just require adding this line to the
TRIVIA_LIST_SCHEMAdictionary:In addition to the review comments, it seems that the default values are still in the property descriptions, they should be removed from there as well.
@ -0,0 +1,61 @@{Missed the removal of default in this one:
numberalready supports integers:numberalready supports integers:numberalready supports integers:@ -0,0 +3,4 @@"$schema": "http://json-schema.org/draft-07/schema#","title": "Red-DiscordBot Trivia List file","type": "object","properties": {I'm unsure this is required but some schema validators seem to reject
$schemafield as having an invalid type whenadditionalPropertiesis set to an array of strings so it's probably better to define it:@ -0,0 +57,4 @@"items": {"type": "string"}}This remains to be unaddressed:
This should work:
Unsure if you know but above remains unaddressed.
It also seems that this PR isn't really blocked by the PR mentioned in the description, it would just need changes if the other one gets merged first. Am I missing something?
Ah I had missed this, I had addressed these changes now.
LGTM, sorry for the delay. As mentioned before, this should now be added to schemastore repository.
https://github.com/SchemaStore/schemastore/pull/2810
#6070 is a backport of this pull request to Red 3.4.