Skip to content

Instantly share code, notes, and snippets.

@Korbeil
Created September 25, 2019 12:01
Show Gist options
  • Save Korbeil/59ae92eb173a2304329952741e637c9b to your computer and use it in GitHub Desktop.
Save Korbeil/59ae92eb173a2304329952741e637c9b to your computer and use it in GitHub Desktop.
Reference in Resposne
<?php
namespace Jane\OpenApi\Tests\Expected\Model;
class FooGetResponse200
{
/**
*
*
* @var int
*/
protected $id;
/**
*
*
* @var string
*/
protected $bar;
/**
*
*
* @return int
*/
public function getId() : int
{
return $this->id;
}
/**
*
*
* @param int $id
*
* @return self
*/
public function setId(int $id) : self
{
$this->id = $id;
return $this;
}
/**
*
*
* @return string
*/
public function getBar() : string
{
return $this->bar;
}
/**
*
*
* @param string $bar
*
* @return self
*/
public function setBar(string $bar) : self
{
$this->bar = $bar;
return $this;
}
}
{
"openapi": "3.0.0",
"info": {
"version": "",
"title": ""
},
"paths": {
"/foo": {
"get": {
"operationId": "foo",
"responses": {
"200": {
"description": "Default response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"bar": {
"$ref": "#/components/schemas/Bar"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Bar": {
"type": "string"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment