Created
November 18, 2024 22:34
-
-
Save yokawasa/dda7b5f97ca313540b3e7fa787b90d59 to your computer and use it in GitHub Desktop.
Revisions
-
yokawasa created this gist
Nov 18, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ # OpenAPI Spec ```yaml openapi: "3.0.0" info: title: Sample API version: "1.0" paths: /user/{id}: get: summary: Get user by ID parameters: - name: id in: path required: true schema: type: integer responses: 200: description: Successful response content: application/json: schema: type: object properties: id: type: integer name: type: string email: type: string ``` # GraphQL schema ``` type User { id: ID! name: String! email: String! } type Query { getUser(id: ID!): User } ``` # JSON Schema ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "email": { "type": "string" } }, "required": ["id", "name", "email"] } ```