Schema for the JSON output of REST API call

We are trying to parse the ‘Issues’ related JSON file that comes as an output of REST API Call to our company’s JIRA URL though ETL Tool Ab Initio.
To do this parsing, we do require the “Schema” of the JSON file, which will be used to generate DML(metadata) in Ab Initio to parse the file.

Request you to please help us with the Schema of “Issues” JSON file of JIRA REST API call.

Hi @kirithebest,

On Cloud:
When you look at the API docs Atlassian publishes (for example https://developer.atlassian.com/cloud/jira/platform/rest/v3/) you can click the three dots button in the top right corner and doenload the openapi json spec. That contains the json schemas for all parameters and responses.

On Server:
Here, it’s a bit more complicated, but you can visit the API docs (for example https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/#api/2/statuscategory-getStatusCategory) and navigate to the method you’re executing. There, you’ll see a little link saying “SCHEMA” that you can expand and that contains the schema for that response object.
Not sure if the openapi.json file is available here anywhere.

Hope this helps,
Tobi

2 Likes

Thanks for the quick response @tobitheo

We are basically using …/rest/api/2/search?jql=project=’…’ as our REST API ‘get’ call to retrieve ‘Issue’ details.
So we went to below URL and picked the schema:
https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/#api/2/search-search

When we tried to generate metadata(dml) in Ab Initio for this schema using “json-to-dml -json-schema-partial” command, we got below error message.

Please see if you can comment or provide input on this. Thanks in advance.

json-to-dml -json-schema-partial schema_json.json
Only empty objects were parsed in the exemplars for the JSON tag, “fields”.
Empty objects must be defined in order to generate valid DML.

Supply a JSON exemplar that defines this object.

I’m not familiar with this tool in particular, but I noticed that the Schema from the docs references another schema definition for fields:

"fields": {
    "type": "object",
    "patternProperties": {
        ".+": {
            "$ref": "#/definitions/field-meta"
        }
    },
    "additionalProperties": false
},

There are also some other $ref entries in that schema. Maybe try and see if you can find them in some other schemas and replace them there? Or maybe @acalantog or @iragudo know how to get the openapi.json file that this document seems to be generated from.

Thanks again @tobitheo,
We tried to use this schema given at api/2/search part of the URL provided, but the generated metadata could not read the data that is unloaded(extracted) from the web service REST API ‘get’ call of https:///rest/api/2/search?jql=project=

Basically we are looking for a Schema that can define the structure of the complete project.