Ensure that all necessary schemas are declared in RAML files

Description

One example:

For any raml file that uses the "validate" trait, that validation.raml file refers to the "errors" schema. Therefore that errors.schema must be declared in the top-level raml file.

Then raml-cop (and any other raml tool that uses the underlying parser) is happy because it can find the error.schema that is referenced from the errors.schema and it can find the parameters.schema that is referenced from error.schema, as they are relative to their parent schema.

However a supporting library inside the RMB does need the additional error.schema and parameters.schema to be excplicitly declared in the top-level raml file.

Now a couple of wrinkles:

A) If RMB is processing a group of raml files, one of them might neglect to declare those schema. If a raml file that was processed earlier did declare them, then they would have been copied to the temp space. Then this latterly processed raml would be able to find the copies. It would seem that all is well. However if the raml files are processed in a different order on another machine (e.g. https://folio-org.atlassian.net/browse/MODUSERS-58#icft=MODUSERS-58) then it would fail.

B) When that supporting library copies those schema to the temp space, if a schema reference uses '../' dot-dot in the pathname, then that schema will be copied one directory level up and so outside of its temp space. When processing is finished, the RMB does remove the temp directory. However it does not remove those extraneous ones outside the temp space (https://folio-org.atlassian.net/browse/RMB-50#icft=RMB-50). Therefore any raml file that had neglected to declare that schema will be successfully processsed because it finds that schema copy by accident.

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

David CrossleyAugust 21, 2018 at 4:17 AM

This was already done for current mod_* modules.

With RMB v20 (https://folio-org.atlassian.net/browse/RMB-109#icft=RMB-109 and https://folio-org.atlassian.net/browse/RMB-203#icft=RMB-203) this is not needed anymore.

Done

Details

Assignee

Reporter

Labels

Priority

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created April 23, 2018 at 3:56 AM
Updated November 12, 2018 at 2:24 PM
Resolved August 21, 2018 at 4:17 AM
TestRail: Cases
TestRail: Runs

Flag notifications