Skip to content

Commit

Permalink
* fix base schema for yaml config files
Browse files Browse the repository at this point in the history
* switch schema to draft2019
  • Loading branch information
oetiker committed Jun 14, 2023
1 parent 6f00c8d commit 1479bde
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions lib/CallBackery/Model/ConfigJsonSchema.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# $Id: Config.pm 539 2013-12-09 22:28:11Z oetiker $
package CallBackery::Model::ConfigJsonSchema;

=head1 NAME
CallBackery::ConfigYAML - get parse configuration file for CallBackery
CallBackery::Model::ConfigJsonSchema - get parse configuration file for CallBackery
=head1 SYNOPSIS
Expand Down Expand Up @@ -73,7 +72,7 @@ has schema => sub ($self) {
};

sub validator ($self) {
my $validator = JSON::Validator->new(version=>7);
my $validator = JSON::Validator->new();
$validator->schema($self->schema);
return $validator;
}
Expand Down Expand Up @@ -112,7 +111,7 @@ sub postProcessCfg ($self) {
$self->loadAndNewPlugin($item->{$name}{module});
};
if ($@){
warn "Failed to load Plugin $_[0]: $@";
warn "Failed to load Plugin $name: $@";
next;
}
$obj->config($item->{$name});
Expand Down Expand Up @@ -175,7 +174,7 @@ __DATA__
@@ config-schema.yaml
$id: https://callbackery.org/config-schema.yaml
$schema: http://json-schema.org/draft-07/schema#
$schema: http://json-schema.org/draft2019/schema#
definitions:
plugin:
type: object
Expand All @@ -189,6 +188,11 @@ definitions:
type: object
type: object
additionalProperties: false
required:
- BACKEND
- FRONTEND
- PLUGIN
properties:
BACKEND:
type: object
Expand Down Expand Up @@ -220,8 +224,7 @@ properties:
format: uri
description: link to the company homepage
max_width:
type: number
format: integer
type: integer
description: maximum content width
company_support:
type: string
Expand Down Expand Up @@ -265,22 +268,23 @@ properties:
passwordreset_popup:
$ref: "#/definitions/plugin"
PLUGIN:
type: array
items:
PLUGIN:
type: array
items:
type: object
maxProperties: 1
minProperties: 1
patternProperty:
^\S+$:
type: object
required:
- module
properties:
^\S+$:
type: object
required:
- module
properties:
module:
type: string
type: string
unlisted:
description: do not add this plugin to the plugin list.
type: boolean
description: do not add this plugin to the plugin list.
type: boolean
Expand Down

0 comments on commit 1479bde

Please sign in to comment.