swagger-php

How can send multipart/form-data file in application/json in swagger php

。_饼干妹妹 提交于 2020-07-22 05:21:07
问题 I want to uplaod a file in swagger-php in the json requestBody How can upload with the help of swagger anonations Trying from lot of hours but not luck how can send and file in application/json array Can you help if any information about this so then i will solve my problem i have not concept about this when this code generate in the terminal also not have any error and not shown in the request body in the swagger ui /** * @OA\Post( * path="/products/save", * tags={"Product"}, * summary="Post

How can I make parameter optional in some but required in other cases in Swagger/PHP?

社会主义新天地 提交于 2020-01-04 05:43:06
问题 I'm documenting PHP REST-API with Swagger. So I defined my datamodel. My current Problem is, that the required state of some fields varies on different request types. My model looks like this: * @SWG\Definition(required={"firstName", "lastName"}) * * @SWG\Property(property="id", type="integer", example="5") * @property integer $id * * @SWG\Property(property="firstName", type="string", example="Test Name") * @property string $firstName * * @SWG\Property(property="lastName", type="string",

how to map this array json in swagger ui?

人走茶凉 提交于 2019-12-25 04:25:20
问题 I am working on swagger ui in php and i am trying to map json like below { "category": { "id": 0, "name": "string" } } I tried it from swagger ui demos but unable to get mapping like above json, how can i get this json mapping, what would be the annotation for that ? please help My swagger class is /** * @SWG\Definition(@SWG\Xml(name="MyFl")) */ class MyFl { /** * @SWG\Property(format="int64") * @var int */ public $id; /** * @SWG\Property(example="doggie") * @var string */ public $name; /** *

swagger-php having different documentations from the same code

…衆ロ難τιáo~ 提交于 2019-12-12 06:17:19
问题 We are using slim framework and swagger-php to dynamically generate the swagger documentation. We now have some special methods in the API that should not be publicly documentated. (/doc now) Is there any way I can have a second documentation url (/doc2) where I can get the secret methods and params documentated? (without having to make the documentation by hand, just using the annotations in the php code). Thanks. 回答1: As per the latest version of swagger-php you can indicate a list of files

How to add correctly a parameter without errors in swagger zircote doctrine

試著忘記壹切 提交于 2019-12-12 04:36:32
问题 i'm using swagger for the first time and the code below results in an "Not a valid parameter definition" error. /** * @SWG\Post( * path="/pub/user/login", * summary="Login", * tags={"User"}, * @SWG\Parameter( * name="phone", * in="formData", * description="The phone from the database", * required=true, * type="string" * ), * @SWG\Parameter( * name="token", * in="formData", * description="The token for this device and phone", * required=true, * type="string" * ), * @SWG\Response( * response

Swagger and json-rpc

自作多情 提交于 2019-12-11 07:32:17
问题 I'm trying to use Swagger-ui for my json-rpc server which was written by php. I use Swagger-PHP to generate json complaint container for Swagger-ui. So, I'm very new to Swagger and I use annotation for methods like that: /** * @SWG\Resource( * apiVersion="0.2", * swaggerVersion="0.8", * basePath="http://mydomain.com", * @SWG\Api( * path="/rpc/json/server.php", * description="Operations about Devices", * @SWG\Operations( * @SWG\Operation( * method="POST", * summary="Get device by ID", *

Two paths for the same method

▼魔方 西西 提交于 2019-12-10 23:20:21
问题 Been trying to use Swagger to generate my documentation for my PHP Rest API, using swagger-php. It's working pretty great, not quite sure if I'm a fan of having huge comment blocks due to the documentation, but that's not the issue. I have two paths: /user/ [POST] /user/login [POST] Both of them call the same method in my PHP code: login(). Is there a way for me to say that /user/ [POST] is just an alias of /user/login [POST] ? I'd like both of them to be present in the list of Operations,

Can I make swagger-php use arrays on the query string?

梦想的初衷 提交于 2019-12-10 17:03:31
问题 I use Swagger-php. When I define a parameter that's on the query string it can be an array. But from what I can see, it doesn't support this kind of querystring: https://api.domain.tld/v1/objects?q[]=1&q[]=5&q[]=12 I believe this would be set in the collectionFormatfield if possible. Currently I've just been using pipes , but I want to use the above format, and have Swagger-UI reflect this, too. However, I read this github issue which has left me wondering if this is actually possible and I

Symfony, nelmio/api-doc-bundle and @SWG\SecurityScheme

倾然丶 夕夏残阳落幕 提交于 2019-12-09 23:43:43
问题 I'm trying to document my Symfony 3.4 application API using nelmio/api-doc-bundle but fail to create a security scheme. Generating the documentation itself works as expected with the following configuration: nelmio_api_doc: documentation: info: description: FooBar API title: FooBar version: 1.0.0 routes: path_patterns: - ^/api/ And the following annotations: /** * @SWG\Get( * security={ * {"ApiKeyAuth":{}} * }, * @SWG\Response( * response=200, * description="Returns all [Foo]", * @SWG\Schema(

Symfony, nelmio/api-doc-bundle and @SWG\\SecurityScheme

不问归期 提交于 2019-12-04 19:22:14
I'm trying to document my Symfony 3.4 application API using nelmio/api-doc-bundle but fail to create a security scheme. Generating the documentation itself works as expected with the following configuration: nelmio_api_doc: documentation: info: description: FooBar API title: FooBar version: 1.0.0 routes: path_patterns: - ^/api/ And the following annotations: /** * @SWG\Get( * security={ * {"ApiKeyAuth":{}} * }, * @SWG\Response( * response=200, * description="Returns all [Foo]", * @SWG\Schema( * type="array", * @Model(type=App\Entity\Foo::class) * ) * ), * @SWG\Response( * response=404, *