Skip to content
Snippets Groups Projects
Select Git revision
  • 7d2f2997234cf9f70bbf88666808b2b9d0167369
  • master default protected
  • macos-arm64
  • readyToRunExecutable
4 results

symfony-api-doc-generator

Jonas Leder's avatar
Jonas Leder authored
7d2f2997
History

Symfony API Documentation Generator

This is a simple .NET CLI tool, which parses a JSON file and returns the annotations needed for the NelmioApiDocBundle.

Usage

Open the Application from the CLI, then paste your JSON and press two times return. Now you get the Annotations matching your JSON. Please note values with null won't get any type.

Example

Input

{
        "id": 4051,
        "name": "manoj",
        "email": "manoj@gmail.com",
        "password": "Test@123",
        "about": null,
        "token": "7f471974-ae46-4ac0-a882-1980c300c4d6",
        "country": null,
        "location": null,
        "dob": null,
        "gender": 0,
        "userType": 1,
        "userStatus": 1,
        "profilePicture": "Images/9b291404-bc2e-4806-88c5-08d29e65a5ad.png",
        "coverPicture": "Images/44af97d9-b8c9-4ec1-a099-010671db25b7.png",
        "enablefollowme": false,
        "sendmenotifications": false,
        "sendTextmessages": false,
        "enabletagging": false,
        "createdAt": "2020-01-01T11:13:27.1107739",
        "updatedAt": "2020-01-02T09:16:49.284864",
  "coordinates": {
   "lng": 77.389849,
   "lat": 28.6282231
  },
        "liveLocation": [
   "Unnamed Road",
   "Chhijarsi",
   "Sector 63", 
   "Noida",
   "Uttar Pradesh 201307",
   "India"
  ],
        "creditBalance": 127,
        "myCash": 0,
  "testarray": [
   {
    "name": "Max",
    "mail": "max@mustermann.de"
   },
   {
    "name": "John",
    "mail": "john@doe.com"
   }
  ]  
}

Output

* @OA\JsonContent(
*   type="object",
*   @OA\Property(
*     property="id"
*     type="integer",
*     example="4051"
*   ),
*   @OA\Property(
*     property="name"
*     type="string",
*     example="manoj"
*   ),
*   @OA\Property(
*     property="email"
*     type="string",
*     example="manoj@gmail.com"
*   ),
*   @OA\Property(
*     property="password"
*     type="string",
*     example="Test@123"
*   ),
*   @OA\Property(
*     property="about"
*   ),
*   @OA\Property(
*     property="token"
*     type="string",
*     example="7f471974-ae46-4ac0-a882-1980c300c4d6"
*   ),
*   @OA\Property(
*     property="country"
*   ),
*   @OA\Property(
*     property="location"
*   ),
*   @OA\Property(
*     property="dob"
*   ),
*   @OA\Property(
*     property="gender"
*     type="integer",
*     example="0"
*   ),
*   @OA\Property(
*     property="userType"
*     type="integer",
*     example="1"
*   ),
*   @OA\Property(
*     property="userStatus"
*     type="integer",
*     example="1"
*   ),
*   @OA\Property(
*     property="profilePicture"
*     type="string",
*     example="Images/9b291404-bc2e-4806-88c5-08d29e65a5ad.png"
*   ),
*   @OA\Property(
*     property="coverPicture"
*     type="string",
*     example="Images/44af97d9-b8c9-4ec1-a099-010671db25b7.png"
*   ),
*   @OA\Property(
*     property="enablefollowme"
*     type="boolean",
*     example="false"
*   ),
*   @OA\Property(
*     property="sendmenotifications"
*     type="boolean",
*     example="false"
*   ),
*   @OA\Property(
*     property="sendTextmessages"
*     type="boolean",
*     example="false"
*   ),
*   @OA\Property(
*     property="enabletagging"
*     type="boolean",
*     example="false"
*   ),
*   @OA\Property(
*     property="createdAt"
*   ),
*   @OA\Property(
*     property="updatedAt"
*   ),
*   @OA\Property(
*     property="coordinates"
*     type="object",
*     @OA\Property(
*       property="lng"
*     ),
*     @OA\Property(
*       property="lat"
*     ),
*   ),
*   @OA\Property(
*     property="liveLocation"
*     type="array",
*     @OA\Items(
*       type="string",
*       example="Unnamed Road"
*     ),
*   ),
*   @OA\Property(
*     property="creditBalance"
*     type="integer",
*     example="127"
*   ),
*   @OA\Property(
*     property="myCash"
*     type="integer",
*     example="0"
*   ),
*   @OA\Property(
*     property="testarray"
*     type="array",
*     @OA\Items(
*       type="object",
*       @OA\Property(
*         property="name"
*         type="string",
*         example="Max"
*       ),
*       @OA\Property(
*         property="mail"
*         type="string",
*         example="max@mustermann.de"
*       ),
*     ),
*   ),
* ),