Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenApi 3.0 : POST /oauth/token #1

Open
piwel opened this issue Jun 5, 2018 · 0 comments
Open

OpenApi 3.0 : POST /oauth/token #1

piwel opened this issue Jun 5, 2018 · 0 comments

Comments

@piwel
Copy link

piwel commented Jun 5, 2018

Hi,

Thanks for your work !

I just want to share one function for OpenApi 3.0, if it could help someone to have a model to build on…

/**
 * @OAS\Post(
 *      path="/oauth/token",
 *      summary="Requests a refresh token",
 *      tags={"OAuth"},
 *      operationId="refreshToken",
 *      @OAS\RequestBody(
 *          description="Request parameters",
 *          required=true,
 *          @OAS\MediaType(
 *              mediaType="application/json",
 *              @OAS\Schema(
 *                  type="object",
 *                  required={"grant_type", "client_id", "client_secret", "scope"},
 *                  @OAS\Property(
 *                      property="grant_type",
 *                      description="refresh_token or password",
 *                      enum={"refresh_token","password"},
 *                      default="password",
 *                      example="password",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *                  @OAS\Property(
 *                      property="client_id",
 *                      description="OAuth Client ID",
 *                      example="1",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *                  @OAS\Property(
 *                      property="client_secret",
 *                      description="OAuth Client Secret",
 *                      example="...",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *                  @OAS\Property(
 *                      property="scope",
 *                      description="What scopes are requested, for all, use '*'",
 *                      example="*",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *                  @OAS\Property(
 *                      property="refresh_token",
 *                      description="Refresh_token from the authorization response",
 *                      example="",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *                  @OAS\Property(
 *                      property="username",
 *                      description="Username for login",
 *                      example="",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *                  @OAS\Property(
 *                      property="password",
 *                      description="Password for the user",
 *                      example="",
 *                      @OAS\Schema(
 *                          type="string"
 *                      )
 *                  ),
 *              )
 *          )
 *      ),
 *      @OAS\Response(
 *          response=200,
 *          description="successful operation",
 *          @OAS\MediaType(
 *              mediaType="application/json",
 *          )
 *      )
 * )
 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant