Open mina-skunk opened 6 years ago
take off the protocol. file://
is not support by ajv and not needed by the specification. For additional examples, please see here: https://spacetelescope.github.io/understanding-json-schema/structuring.html
With out file://
you get:
Unable to determine the domain name Error: Unable to determine the domain name at new ClientRequest (_http_client.js:85:13) at request (http.js:38:10) at Object.get (http.js:42:13) at Promise (C:\Users\User\source\repos\AutoFluent-Cloud\autofluent-clients\node_modules\@angular-devkit\core\src\json\schema\registry.js:74:18) at new Promise (
) at CoreSchemaRegistry._fetch (C:\Users\User\source\repos\AutoFluent-Cloud\autofluent-clients\node_modules\@angular-devkit\core\src\json\schema\registry.js:73:16) at Object.loadSchema (C:\Users\User\source\repos\AutoFluent-Cloud\autofluent-clients\node_modules\@angular-devkit\core\src\json\schema\registry.js:61:39) at loadMissingSchema (C:\Users\User\source\repos\AutoFluent-Cloud\autofluent-clients\node_modules\@angular-devkit\core\node_modules\ajv\lib\compile\async.js:67:64) at _compileAsync (C:\Users\User\source\repos\AutoFluent-Cloud\autofluent-clients\node_modules\@angular-devkit\core\node_modules\ajv\lib\compile\async.js:56:48) at C:\Users\User\source\repos\AutoFluent-Cloud\autofluent-clients\node_modules\@angular-devkit\core\node_modules\ajv\lib\compile\async.js:32:34
@clydin please reopen as it is still not possible to use relative schema references.
@clydin also following https://spacetelescope.github.io/understanding-json-schema/structuring.html I added an id
but now get Request failed. Status Code: 404
, I don't want to publicly host my schema
The current implementation only use http for asynchronous schema compilation using the loadSchema
option of ajv
, then we are only able to reference schemas using http (for which there no really extended usefullness, most schema json on the web are available using https), neither https nor a local file are available,
this._ajv = ajv({
formats: formatsObj,
loadSchema: (uri) => this._fetch(uri),
schemaId: 'auto',
passContext: true,
});
The implementation of the _fetch
in registry.js
should allow to handle file://
(possibly simply using the path
module + a require()
), http://
(with the http
module, already implemented), https://
(with the https
module). This way there will be freedom of choice when build schemas
Any news?
wow, the extension of local schemas is quite a big deal and it's just not a priority :thinking:
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Bug Report or Feature Request (mark with an
x
)Area
Versions
node --version v8.11.1 npm --version 6.1.0
Repro steps
or
The log given by the failure
or
Desired functionality
$ref
relative schemas