Skip to content

Commit

Permalink
Add OAS case
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Sep 12, 2023
1 parent 2c9f34b commit 1f41e00
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 2 deletions.
79 changes: 79 additions & 0 deletions spec/functional_test/fixtures/multi_techs/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
openapi: 3.0.0
info:
title: Pet Store API
version: 1.0.0
description: Sample API for managing pets in a pet store.
servers:
- url: 'https://api.example.com/v1'
paths:
/pets:
get:
summary: Get a list of pets
responses:
'200':
description: A list of pets
content:
application/json:
example:
- id: 1
name: Fluffy
- id: 2
name: Fido
post:
summary: Add a new pet
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
required:
- name
responses:
'201':
description: Pet added successfully
'/pets/{petId}':
get:
summary: Get information about a specific pet
parameters:
- name: petId
in: path
required: true
schema:
type: integer
responses:
'200':
description: Information about the pet
content:
application/json:
example:
id: 1
name: Fluffy
breed: Cat
put:
summary: Update information about a specific pet
parameters:
- name: petId
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
breed:
type: string
required:
- name
responses:
'200':
description: Pet information updated successfully
8 changes: 6 additions & 2 deletions spec/functional_test/testers/multi_techs_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ extected_endpoints = [
Endpoint.new("/update", "POST"),
Endpoint.new("/query", "POST", [Param.new("query", "", "form")]),
Endpoint.new("/socket", "GET"),
Endpoint.new("/pets", "GET"),
Endpoint.new("/pets", "POST"),
Endpoint.new("/pets/{petId}", "GET"),
Endpoint.new("/pets/{petId}", "PUT"),
]

FunctionalTester.new("fixtures/multi_techs/", {
:techs => 2,
:endpoints => 4,
:techs => 3,
:endpoints => 8,
}, extected_endpoints).test_all

0 comments on commit 1f41e00

Please sign in to comment.