第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Flask 嵌套的 rest api 招搖不工作

Flask 嵌套的 rest api 招搖不工作

嗶嗶one 2021-09-14 15:13:19
address = api.schema_model('Address', {    'properties': {        'road': {            'type': 'string'        },    },    'type': 'object' })person = address = api.schema_model('Person', {    'required': ['address'],    'properties': {        'name': {            'type': 'string'        },        'age': {            'type': 'integer'        },        'birthdate': {            'type': 'string',            'format': 'date-time'        },        'address': {            '$ref': '#/definitions/Address',        }    },    'type': 'object' })錯(cuò)誤在定義中隱藏解析器錯(cuò)誤。Person.properties.address.$ref 無法解析引用,因?yàn)椋簾o法解析指針:/NestedModel 在文檔中不存在
查看完整描述

1 回答

?
浮云間

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超4個(gè)贊

最后我可以用下面的代碼解決問題


nested_fields = api.schema_model('NestedModel', {'name': fields.String})

person = address = api.schema_model('Person', {

    'required': ['address'],

    'properties': {

        'name': {

            'type': 'string'

        },

        'age': {

            'type': 'integer'

        },

        'birthdate': {

            'type': 'string',

            'format': 'date-time'

        },

        'address': {


            'properties': {

                'arguments': {

                    'type': 'array',

                    'items': {


                    }

                }

            },

            'type': 'object'

        }

    },

    'type': 'object'

})


查看完整回答
反對(duì) 回復(fù) 2021-09-14
  • 1 回答
  • 0 關(guān)注
  • 206 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)