github.com/circl-dev/go-swagger@v0.31.0/examples/oauth2/swagger.yml (about) 1 --- 2 3 swagger: '2.0' 4 info: 5 title: oauth2 debug 6 version: 0.3.0 7 produces: 8 - application/json 9 schemes: 10 - http 11 basePath: /api 12 securityDefinitions: 13 OauthSecurity: 14 type: oauth2 15 flow: accessCode 16 authorizationUrl: 'https://accounts.google.com/o/oauth2/v2/auth' 17 tokenUrl: 'https://www.googleapis.com/oauth2/v4/token' 18 scopes: 19 admin: Admin scope 20 user: User scope 21 security: 22 - OauthSecurity: 23 - user 24 paths: 25 /login: 26 get: 27 summary: login through oauth2 server 28 security: [] 29 responses: 30 '200': 31 description: login 32 schema: 33 properties: 34 access_token: 35 type: string 36 format: string 37 default: 38 description: error 39 schema: 40 $ref: "#/definitions/error" 41 /auth/callback: 42 get: 43 summary: return access_token 44 security: [] 45 responses: 46 '200': 47 description: login 48 schema: 49 properties: 50 access_token: 51 type: string 52 format: string 53 default: 54 description: error 55 schema: 56 $ref: "#/definitions/error" 57 /customers: 58 post: 59 tags: ["customers"] 60 operationId: create 61 summary: Create a new customer to track 62 parameters: 63 - name: info 64 in: body 65 schema: 66 $ref: "#/definitions/customer" 67 responses: 68 '201': 69 description: created 70 schema: 71 $ref: "#/definitions/customer" 72 default: 73 description: error 74 schema: 75 $ref: "#/definitions/error" 76 get: 77 tags: ["customers"] 78 operationId: getId 79 summary: Get a customerId given an SSN 80 parameters: 81 - name: info 82 in: body 83 schema: 84 $ref: "#/definitions/social_id" 85 responses: 86 '200': 87 description: OK 88 schema: 89 $ref: "#/definitions/customer" 90 '401': 91 description: unauthorized 92 schema: 93 $ref: "#/definitions/error" 94 '404': 95 description: resource not found 96 schema: 97 $ref: "#/definitions/error" 98 default: 99 description: error 100 schema: 101 $ref: "#/definitions/error" 102 definitions: 103 customer: 104 type: object 105 required: 106 - customerId 107 - name 108 - surname 109 - ssn 110 - fipsCode 111 properties: 112 customerId: 113 type: integer 114 format: int64 115 readOnly: true 116 description: internal identifier of a customer 117 name: 118 type: string 119 format: string 120 minLength: 1 121 surname: 122 type: string 123 format: string 124 minLength: 1 125 agentId: 126 type: integer 127 format: int32 128 description: agent associated with this customer 129 ssn: 130 type: string 131 format: string 132 minLength: 11 133 description: Lookup identifier to find a customer in the system 134 fipsCode: 135 type: string 136 format: string 137 minLength: 1 138 social_id: 139 type: object 140 required: 141 - ssn 142 properties: 143 ssn: 144 type: string 145 format: string 146 minLength: 11 147 error: 148 type: object 149 required: 150 - message 151 properties: 152 code: 153 type: integer 154 format: int64 155 message: 156 type: string 157 fields: 158 type: string 159 principal: 160 type: string