Back to Swagger Php

Example Reference

docs/guide/examples.md

6.1.26.7 KB
Original Source

Example Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR ;)

Api

A simple API example uing enums, traits and callbacks.

Server.php

<codeblock id="api-Server"> <template v-slot:at>

<<< @/examples/specs/api/attributes/Server.php

</template> <template v-slot:an>

<<< @/examples/specs/api/annotations/Server.php

</template> </codeblock>

Product.php

<codeblock id="api-Product"> <template v-slot:at>

<<< @/examples/specs/api/attributes/Product.php

</template> <template v-slot:an>

<<< @/examples/specs/api/annotations/Product.php

</template> </codeblock>

NameTrait.php

<codeblock id="api-NameTrait"> <template v-slot:at>

<<< @/examples/specs/api/attributes/NameTrait.php

</template> <template v-slot:an>

<<< @/examples/specs/api/annotations/NameTrait.php

</template> </codeblock>

Colour.php

<codeblock id="api-Colour"> <template v-slot:at>

<<< @/examples/specs/api/attributes/Colour.php

</template> <template v-slot:an>

<<< @/examples/specs/api/annotations/Colour.php

</template> </codeblock>

OpenApiSpec.php

<codeblock id="api-OpenApiSpec"> <template v-slot:at>

<<< @/examples/specs/api/attributes/OpenApiSpec.php

</template> <template v-slot:an>

<<< @/examples/specs/api/annotations/OpenApiSpec.php

</template> </codeblock>

ProductController.php

<codeblock id="api-ProductController"> <template v-slot:at>

<<< @/examples/specs/api/attributes/ProductController.php

</template> <template v-slot:an>

<<< @/examples/specs/api/annotations/ProductController.php

</template> </codeblock>

Petstore

Classic petstore sample app. Uses OAuth

Models/Category.php

<codeblock id="petstore-Category"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/Category.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/Category.php

</template> </codeblock>

Models/Order.php

<codeblock id="petstore-Order"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/Order.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/Order.php

</template> </codeblock>

Models/PetRequestBody.php

<codeblock id="petstore-PetRequestBody"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/PetRequestBody.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/PetRequestBody.php

</template> </codeblock>

Models/Tag.php

<codeblock id="petstore-Tag"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/Tag.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/Tag.php

</template> </codeblock>

Models/User.php

<codeblock id="petstore-User"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/User.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/User.php

</template> </codeblock>

Models/ApiResponse.php

<codeblock id="petstore-ApiResponse"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/ApiResponse.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/ApiResponse.php

</template> </codeblock>

Models/UserArrayRequestBody.php

<codeblock id="petstore-UserArrayRequestBody"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/UserArrayRequestBody.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/UserArrayRequestBody.php

</template> </codeblock>

Models/Pet.php

<codeblock id="petstore-Pet"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Models/Pet.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Models/Pet.php

</template> </codeblock>

Security.php

<codeblock id="petstore-Security"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Security.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Security.php

</template> </codeblock>

Controllers/UserController.php

<codeblock id="petstore-UserController"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Controllers/UserController.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Controllers/UserController.php

</template> </codeblock>

Controllers/StoreController.php

<codeblock id="petstore-StoreController"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Controllers/StoreController.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Controllers/StoreController.php

</template> </codeblock>

Controllers/PetController.php

<codeblock id="petstore-PetController"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Controllers/PetController.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Controllers/PetController.php

</template> </codeblock>

Petstore.php

<codeblock id="petstore-Petstore"> <template v-slot:at>

<<< @/examples/specs/petstore/attributes/Petstore.php

</template> <template v-slot:an>

<<< @/examples/specs/petstore/annotations/Petstore.php

</template> </codeblock>

Polymorphism

Demonstrates the use of Discriminator

Controller.php

<codeblock id="polymorphism-Controller"> <template v-slot:at>

<<< @/examples/specs/polymorphism/attributes/Controller.php

</template> <template v-slot:an>

<<< @/examples/specs/polymorphism/annotations/Controller.php

</template> </codeblock>

Request.php

<codeblock id="polymorphism-Request"> <template v-slot:at>

<<< @/examples/specs/polymorphism/attributes/Request.php

</template> <template v-slot:an>

<<< @/examples/specs/polymorphism/annotations/Request.php

</template> </codeblock>

Employee.php

<codeblock id="polymorphism-Employee"> <template v-slot:at>

<<< @/examples/specs/polymorphism/attributes/Employee.php

</template> <template v-slot:an>

<<< @/examples/specs/polymorphism/annotations/Employee.php

</template> </codeblock>

AbstractResponsible.php

<codeblock id="polymorphism-AbstractResponsible"> <template v-slot:at>

<<< @/examples/specs/polymorphism/attributes/AbstractResponsible.php

</template> <template v-slot:an>

<<< @/examples/specs/polymorphism/annotations/AbstractResponsible.php

</template> </codeblock>

Fl.php

<codeblock id="polymorphism-Fl"> <template v-slot:at>

<<< @/examples/specs/polymorphism/attributes/Fl.php

</template> <template v-slot:an>

<<< @/examples/specs/polymorphism/annotations/Fl.php

</template> </codeblock>