🔥 Removed versioning from json schema validation

refs https://github.com/TryGhost/Toolbox/issues/314

- With versioned API concept being dropped there's no need to rely on a specific version in validations either!
This commit is contained in:
Naz 2022-05-12 16:08:23 +08:00
parent 7252f03824
commit d3f432f745
3 changed files with 6 additions and 7 deletions

View File

@ -10,8 +10,7 @@ const jsonSchema = require('@tryghost/admin-api-schema');
*/
const validate = async (apiConfig, frame) => await jsonSchema.validate({
data: frame.data,
schema: `${apiConfig.docName}-${apiConfig.method}`,
version: 'canary'
schema: `${apiConfig.docName}-${apiConfig.method}`
});
module.exports.validate = validate;

View File

@ -57,7 +57,7 @@
"dependencies": {
"@sentry/node": "6.19.7",
"@tryghost/adapter-manager": "0.2.30",
"@tryghost/admin-api-schema": "2.17.0",
"@tryghost/admin-api-schema": "3.0.0",
"@tryghost/api-version-compatibility-service": "0.4.1",
"@tryghost/bookshelf-plugins": "0.4.1",
"@tryghost/bootstrap-socket": "0.2.19",

View File

@ -1719,10 +1719,10 @@
dependencies:
"@tryghost/errors" "^1.2.1"
"@tryghost/admin-api-schema@2.17.0":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@tryghost/admin-api-schema/-/admin-api-schema-2.17.0.tgz#536efe5d0b6d6ff43805e5ad3a10b95102354150"
integrity sha512-odbgzACnySa7//PiXmaUSMNkaNqzCIl1ya/cjfUAAN68UGRDI4MCAlK2lqqRFsvihrxxlV25lFJ8TwT1o5ji8w==
"@tryghost/admin-api-schema@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@tryghost/admin-api-schema/-/admin-api-schema-3.0.0.tgz#e0d091b75c95450baaefa7d40a80bab3aa15e47e"
integrity sha512-F5eDQinVpew2jJMriQ0UrNegW4PWewK18ylbSGFRBax5EJPBY67A8g1nZpSmuC/gMArkIX4IVyyCtTniF6epvQ==
dependencies:
"@tryghost/errors" "^1.0.0"
lodash "^4.17.11"