0

タイトルが少しわかりにくいかもしれないので、私が達成しようとしていることは次のとおりです。

どちらも POST 呼び出しである RAML を使用して、token_grant メソッドと token_refresh メソッドを文書化する必要があります。

token_grant : 初めて OAuth トークンを生成する token_refresh : アクセス トークンを更新する

それらはクエリ パラメータが異なり、もちろん返される結果も異なります。問題は、それらが両方とも同じリソースの下にあり、RAML が各リソースに対して 1 つの POST 呼び出ししか許可しないことです。

 /oauth/token

ポストコールを 1 回に制限して、これを回避する方法はありますか? たぶん、クエリパラメータに応じて条件付きのものを持っているのでしょうか?

token_grantのテンプレートは次のとおりです。

/oauth/token:  
   post:
     description:
     headers:
       Authorization:
         type: "string"
         default: "[client_id:]"
         required: true
         example: 
     queryParameters:
       grant_type:
         type: string
         required: true
         example: ''
       code:
         type: string
         required: true
         example: ''
     responses:
       200:
         body:
         application/json:
       example: |

token_refreshのテンプレートは次のとおりです。

/oauth/token:  
   post:
     description:
     headers:
       Authorization:
         type: "string"
         default: "[client_id:]"
         required: true
         example: 
     queryParameters:
       grant_type:
         type: string
         required: true
         example: ''
       //Main difference1
       refresh_token:
         type: string
         required: true
         example: ''
     responses:
       200:
         body:
          application/json:
          //Main difference 2
          example: "a different response goes here"

したがって、主な問題は、これらを下にまとめる方法です

/oauth/token/

どんな助けでも大歓迎です どうもありがとう!

4

1 に答える 1