[FOLIO-1213] Using an "id" property in JSON Schema with a leading slash causes failed raml2html Created: 18/Apr/18 Updated: 12/Nov/18 Resolved: 03/May/18 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | P3 |
| Reporter: | David Crossley | Assignee: | David Crossley |
| Resolution: | Done | Votes: | 0 |
| Labels: | core, raml, sprint36, sprint37 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 1 day, 1 hour, 35 minutes | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||||||
| Sprint: | |||||||||||||
| Description |
|
Recently an experimental "id" property was added to some schema to assist another RAML tool to operate. However that causes raml2html to fail. |
| Comments |
| Comment by David Crossley [ 18/Apr/18 ] |
|
See notes in raml/pull/77 "Add id property to error schema to facilitate response validation". As said there, raml-cop and RMB are okay with it (probably because they do not utilise this property). At that time i must have neglected to run another local test, i.e. to use raml2html. That tool is run by our CI during merge to master, but we do not fail the build on error, nor do we expose any errors. So we did not notice that it fails. Another tool raml-fleece is also run during CI. It is okay with that "id" (or does not utilise it). We use version 3 of raml2html. Later versions have stopped doing schema rendering, so maybe do not encounter this problem. However they only handle RAML 1.0 |
| Comment by David Crossley [ 18/Apr/18 ] |
|
Marc Johnson the mod-inventory master is now using a more recent raml-util that includes this change, but it seems to not utilise this "id". Perhaps you have a local experimental branch that does. Are you okay with removing this addition of "id" in the shared "raml" repository? |
| Comment by Marc Johnson [ 18/Apr/18 ] |
|
David Crossley I think we may have to remove the id property at this point. I don't see an immediate way to resolve this, given that we have different roots for our schema depending upon the context. In the RAML repository, the root is the the RAML repository, whereas in each module the root is the RAML directory of the module, and the shared RAML is kept under that at raml-util. The only aspect of the system (that I'm aware of) that uses the id to resolve schema is the validation of responses in tests. This can likely be easily removed fairly quickly following it's removal. It may be that further research into how schema are resolved could reveal a better approach (I think the way the RAML tools resolves them is different than if the schema are intended to be resolved independently, and this may not be consistent) |
| Comment by David Crossley [ 18/Apr/18 ] |
|
Ah, interesting. I copied those changed schemas to mod-inventory-storage which does have the 'validate' trait declared, and those accompanying schemas declared. The raml2html there has those same problems. |
| Comment by David Crossley [ 18/Apr/18 ] |
|
Removed the id in raml/pull/82 until further research. |
| Comment by Marc Johnson [ 18/Apr/18 ] |
|
David Crossley Reviewed and merged |
| Comment by David Crossley [ 02/May/18 ] |
|
The ramls/raml-util now needs to be updated for mod-inventory and mod-circulation and mod-rtac, as they are using raml-util that contains these "id" properties. |
| Comment by David Crossley [ 03/May/18 ] |
|
Done |