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
type User {
id: ID!
name: String!
email: String!
}
type Query {
getUser(id: ID!): User
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string" }
},
"required": ["id", "name", "email"]
}