0

我的代码如下所示:

...
from flask_restx import fields
from flask_restx import Resource
from demo.api.restx import api
...

ns = api.namespace('api/oxp/'+'v'+api.version+'/profile', description='Operations related to profiles')

scopes = api.model('Resource', {
    'scopes': fields.List(fields.String),
})

@ns.route('/<account_id>/<pvp_type>')
@api.doc(params={'account_id': 'An account ID'})
@api.doc(params={'pvp_type': 'A policy validation point type (example: OSCO)'})
@api.response(200, 'Success.')
@api.response(404, 'Failure, with reason.')
class ProfileItem(Resource):
    
    @ns.expect(scopes)
    def post(self, account_id, pvp_type):
    ...

在 swagger 页面上,参数的顺序是 1. scopes 2. pvp_type 3. account_id,但我想要一个不同的顺序。如何做到这一点?谢谢。

4

0 回答 0