[FOLIO-912] Improve configuration for RAML schema collection Created: 26/Oct/17  Updated: 18/Jan/19

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

Type: Task Priority: P3
Reporter: David Crossley Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: raml
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Relates
relates to FOLIO-573 Use a consistent method for RAML to r... Closed
Sprint:
Development Team: Core: Platform

 Description   

Clarify the advice for configuration of schema collections.



 Comments   
Comment by David Crossley [ 26/Oct/17 ]

We have the configuration advice (RMB readme section 6):

When any schema file refers to an additional schema file, then also use that pathname (including filename extension) of the referenced second schema as the "key" name in the RAML "schemas" section, and wherever that schema is utilised in RAML files.

That has been applied to all of the existing mod-* projects, and is working fine.

That advice is for a "schemaItem". For a "schemaCollection", the schema key name does not have the filename extension. So the following example for mod-notes note.raml

schemas:
  - note.json: !include note.json
  - noteCollection: !include noteCollection.json

The RMB's jsonschema2pojo generates the class names "Note" and "NoteCollection".

If instead this was the configuration:

schemas:
  - note.json: !include note.json
  - noteCollection.json: !include noteCollection.json

Then the generated class names would be "Note" and "NoteCollectionJson". I presume that we do not want that.

There is a "note" at the RMB section 6 to try to explain that. However i have seen people still confused about the configuration. Perhaps enhance the notes.

Perhaps it would help to group the schema declarations in the RAML into schemaItems and schemaCollections.

The name used to declare a schemaCollection defines its Java class name.

The name used to declare a schemaItem correlates with that used in its $ref in the collection schema.

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