[FOLIO-1220] Ensure that all necessary schemas are declared in RAML files Created: 23/Apr/18  Updated: 12/Nov/18  Resolved: 21/Aug/18

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Bug Priority: P3
Reporter: David Crossley Assignee: Unassigned
Resolution: Done Votes: 0
Labels: raml
Remaining Estimate: Not Specified
Time Spent: 4 hours, 55 minutes
Original estimate: Not Specified

Issue links:
Relates
relates to FOLIO-1040 Tidy and clarify shared raml-util and... Closed
relates to MODUSERS-58 mod-users won't build from git checkout Closed
relates to RMB-50 Clean the temp space after build to r... Closed
relates to MODUSERS-74 mvn install fails Closed
Sprint:

 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. MODUSERS-58 Closed ) 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 ( RMB-50 Closed ). Therefore any raml file that had neglected to declare that schema will be successfully processsed because it finds that schema copy by accident.



 Comments   
Comment by David Crossley [ 21/Aug/18 ]

This was already done for current mod_* modules.

With RMB v20 ( RMB-109 Closed and RMB-203 Closed ) this is not needed anymore.

Generated at Thu Feb 08 23:11:43 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.