json-schema-normalizer icon indicating copy to clipboard operation
json-schema-normalizer copied to clipboard

reduce in resolveSchema undefined

Open alepri51 opened this issue 7 years ago • 0 comments

replace reduce in func resolveSchema in loadSchemas.js with find: const foundSchema = jsonSchemas.reduce( (result, schema) => (schema.title === schemaName ? schema : undefined), undefined ) should be: const foundSchema = jsonSchemas.find(schema => schema.title === schemaName && schema);

reduce return last schema, than's not always a required result

no pull request, it's too long for me

alepri51 avatar Nov 13 '18 16:11 alepri51