MockAPI for simple Login
openapi: "3.0.0"
title: MockAPI
description: This is a sample server.
termsOfService: http://example.com/terms/
contact:
name: API Support
url: http://www.example.com/support
email: support@example.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.1
components:
schemas:
User:
type: object
properties:
email:
type: string
default: "test@gmail.com"
password:
type: string
default: "test"
servers:
- url: https://api.example.com/v1/users
paths:
/login:
post:
summary: User Login
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/User"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
# items:
# $ref: '#/components/schemas/User'
"401":
description: Invalid credentials
Note: As I'm new to openapi 3.0.0 and trying to create a mock API for login. Added yaml file above for reference. Kindly refer and support me the correct openapi 3.0.0 for a simple login mock API. Thanks in advance