Я установил swashbuckle.OData и swashbuckle с nuget в моем OData API . Когда я запускаю приложение, то в браузере я ставлю « swagger » после « localhost: 53000 » в адресной строке ( localhost: 53000 / swagger ). И он дает мне свой чванливый документ, как на картинке ниже:
![enter image description here](https://i.stack.imgur.com/q1QMu.png)
И я вставляю полученный адрес (localhost: 53000 / swagger / docs / v1) в адресную строку другой вкладки моего браузера, а затем он дает мне некоторые данные в формате json, и я копирую и вставляю все эти данные на веб-сайт. « editor.swagger.io », а затем я сталкиваюсь с ошибками в «editor.swagger.io». Ошибка == >> (Семантическая ошибка в путях ./BankBranches.get.responses.200.schema.$ref $ ref значения должны быть RFC3986-совместимыми процентными URI, закодированными в процентах).
Эта ошибка из-за "[" и "]" в части ответов в редакторе сваггеров == >> $ ref: '# / definitions / ODataResponse [List [BankBranch]]'.
/BankBranches:
get:
tags:
- BankBranches
summary: Returns the EntitySet BankBranches
operationId: BankBranches_GetBankBranches
consumes: []
produces:
- application/json
parameters:
- name: $expand
in: query
description: Expands related entities inline.
required: false
type: string
- name: $filter
in: query
description: 'Filters the results, based on a Boolean condition.'
required: false
type: string
- name: $select
in: query
description: Selects which properties to include in the response.
required: false
type: string
- name: $orderby
in: query
description: Sorts the results.
required: false
type: string
- name: $top
in: query
description: Returns only the first n results.
required: false
type: integer
format: int32
- name: $skip
in: query
description: Skips the first n results.
required: false
type: integer
format: int32
- name: $count
in: query
description: Includes a count of the matching results in the response.
required: false
type: boolean
responses:
'200':
description: OK
schema:
$ref: '#/definitions/ODataResponse[List[BankBranch]]'
deprecated: false
Я знаю, что должен удалить "[" и "]". Я имею в виду, что если я изменю ($ ref: '# / Definitions / ODataResponse [List [BankBranch]]') на ($ ref: '# / Definings / ODataResponseListBankBranch'), то проблема будет решена. Я не знаю, как заставить мой OData API не создавать эту ошибку ????