File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import * as draft4MetaSchema from "./refs/json-schema-draft-04.json"
6
6
7
7
const META_SUPPORT_DATA = [ "/properties" ]
8
8
9
- const META_SCHEMA_ID = "https ://json-schema.org/draft-04/schema"
9
+ const META_SCHEMA_ID = "http ://json-schema.org/draft-04/schema"
10
10
11
11
class Ajv extends AjvCore {
12
12
constructor ( opts : Options = { } ) {
@@ -30,6 +30,12 @@ class Ajv extends AjvCore {
30
30
: draft4MetaSchema
31
31
this . addMetaSchema ( metaSchema , META_SCHEMA_ID , false )
32
32
this . refs [ "http://json-schema.org/schema" ] = META_SCHEMA_ID
33
+
34
+ // Add a copy of the schema for HTTPS references:
35
+ const httpsId = META_SCHEMA_ID . replace ( / ^ h t t p : / , "https:" )
36
+ const httpsSchema = JSON . parse ( JSON . stringify ( metaSchema ) ) as AnySchemaObject
37
+ httpsSchema . id = httpsSchema . $schema = httpsId + "#"
38
+ this . addMetaSchema ( httpsSchema , httpsId , false )
33
39
}
34
40
35
41
defaultMeta ( ) : string | AnySchemaObject | undefined {
Original file line number Diff line number Diff line change 1
1
{
2
- "id" : " https ://json-schema.org/draft-04/schema#" ,
3
- "$schema" : " https ://json-schema.org/draft-04/schema#" ,
2
+ "id" : " http ://json-schema.org/draft-04/schema#" ,
3
+ "$schema" : " http ://json-schema.org/draft-04/schema#" ,
4
4
"description" : " Core schema meta-schema" ,
5
5
"definitions" : {
6
6
"schemaArray" : {
You can’t perform that action at this time.
0 commit comments