Skip to content

Instantly share code, notes, and snippets.

@elsmr
Created March 19, 2021 13:20
Show Gist options
  • Save elsmr/304f66e4cd6abfe3159607792ff9c2a7 to your computer and use it in GitHub Desktop.
Save elsmr/304f66e4cd6abfe3159607792ff9c2a7 to your computer and use it in GitHub Desktop.
Cat/dog example for IBM/openapi-to-graphql
{
"openapi": "3.0.0",
"info": {
"title": "Example",
"description": "Example",
"version": "1.0.0"
},
"paths": {
"/cat123": {
"get": {
"x-graphql-name": "cat",
"responses": {
"200": {
"description": "test",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pet"
}
}
}
}
}
}
},
"/dog123": {
"get": {
"x-graphql-name": "dog",
"responses": {
"200": {
"description": "test",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pet"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"pet": {
"type": "object",
"properties": {
"petName": {
"type": "string"
},
"favoriteFood": {
"type": "string"
}
},
"x-graphql-name": "Pet"
}
}
},
"security": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment