[FOLIO-1411] Add JSON Schemas to RAML for mod-ebsco-kb Created: 09/Aug/18  Updated: 12/Nov/18  Resolved: 27/Aug/18

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

Type: Task Priority: P3
Reporter: Mike Taylor Assignee: Charles Lowell
Resolution: Done Votes: 0
Labels: frontside, stripes-force
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Blocks
blocks MODGQL-47 Target mod-graphql on the RAML for mo... Closed
Relates
relates to UIEH-527 Write JSON Schema for GET Providers Closed
Sprint:

 Description   

In order for mod-graphql to be able to generate GraphQL Schema corresponding to the mod-ebsco-kb RAML, that specification needs to be extended with JSON Schemas describing the form of the returned records. (These are used to determine which fields can be requested.)

The RAML is found at https://github.com/folio-org/mod-inventory-storage/blob/master/ramls/instance-storage.raml



 Comments   
Comment by Mike Taylor [ 09/Aug/18 ]

(Initially assigned to Charles Lowell – Charles, feel free to reassign as works best for you.)

Comment by Mike Taylor [ 09/Aug/18 ]

Here's a worked example of how JSON Schemas are used in this context. (It's test-case #6 from mod-graphql).

I feed it the RAML

title: simple API  

schemas:
  - personSchema: !include schemas/person.json

/person:
  get:
    queryParameters:
      name:
      maxCount: {type: number}
      queryString: {type: string}
    responses:
      200:
        body:
          application/json:
            schema: personSchema

And it pulls in the nominated JSON Schema `schemas/person.json` which says:

{
  "type": "object",
  "$schema": "http://json-schema.org/draft-03/schema",
  "properties": {
    "name": {
      "type": "string"
    },
    "address": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ]
}

And the mod-graphql translator spits out the corresponding GraphQL schema:

# title: simple API

type Query {
  person(name: String, maxCount: Float, queryString: String): TpersonSchema
}

type TpersonSchema {
  address: String
  name: String!
}

where the field-names address and name (and their types) are drawn from the JSON Schema.

Comment by Khalilah Gambrell [ 21/Aug/18 ]

Mike Taylor - will UIEH-527 Closed partially address this request?

Comment by Mike Taylor [ 22/Aug/18 ]

Yes, it will! I'll comment further over on that issue. Thanks.

Comment by Mike Taylor [ 27/Aug/18 ]

We now have JSON Schemas for at least some of the eHoldings RAML. I'm calling that "good enough" for now. We can close this issue, and once we have GraphQL working properly for the fully specced endpoints, we'll file a new one for filling in the rest of the JSON Schemas.

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