Server : LiteSpeed System : Linux in-mum-web1949.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : u595547767 ( 595547767) PHP Version : 7.4.33 Disable Function : NONE Directory : /opt/go/pkg/mod/github.com/go-openapi/validate@v0.24.0/fixtures/validation/ |
swagger: '2.0'
info:
title: test example
version: "1.0.0"
produces:
- application/json
paths:
/v1/broker/{customer_id}:
get:
#operationId: a
parameters:
- $ref: "#/parameters/customerIdParam"
responses:
200:
# in line example
description: Customer
schema:
type: object
properties:
id:
type: string
format: uuid
email:
type: string
format: email
create_date:
type: string
format: date-time
examples:
application/json:
id: mycustomer
email: mycustomer@ripoffpark.com
create_date: bad-date
/v1/vendor/{customer_id}:
get:
#operationId: b
parameters:
- $ref: "#/parameters/customerIdParam"
responses:
200:
description: Customer
schema:
$ref: '#/definitions/customer2'
/v1/customer/{customer_id}:
get:
#operationId: c
parameters:
- $ref: "#/parameters/customerIdParam"
responses:
200:
description: Customer
schema:
$ref: '#/definitions/customer'
parameters:
customerIdParam:
name: customer_id
description: The ID of the customer
in: path
required: true
type: string
format: uuid
example: xyz #<---- example not allowed here
definitions:
# example property by property
customer:
type: object
required:
- id
properties:
id:
type: string
format: uuid
description: The unique ID of the customer
example: 123
email:
type: string
format: email
description: The email address of the customer
example: 123
create_date:
type: string
format: date-time
description: The date and time when the customer was created
example: 123
# example at object level
customer2:
type: object
required:
- id
properties:
id:
type: string
format: uuid
description: The unique ID of the customer
email:
type: string
format: email
description: The email address of the customer
create_date:
type: string
format: date-time
description: The date and time when the customer was created
example:
id: 'mycustomer'
email: 'mycustomer@ripoffpark.com'
create_date: bad-date