1

以下を含む OpenAPI v3 仕様ファイルがあります (フラグメントのみを表示)。

paths:
  /global/name:
    get:
    description: Some description
    tags:
      - Global settings
    operationId: getGlobalSettingsName
    responses:
      # Response code
      '200':
        description: Successful response
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/globalSettingsName'

components:
  schemas:
    globalSettingsName:
      type: object
      properties:
        name:
          type: integer
          description: 'ID'
          example: 1
      required:
        - name

しかし、サーバーの応答は次のとおりです。

{
  "name": "somestring"
}

name プロパティ タイプはintegerであり、サーバーの応答ではstring(意図的に) ですが、dredd要求はパスします (成功)。

dredd応答プロパティの種類をチェックしませんか?

応答をstring(JSONではなく)次のように再定義しました。

responses:
    # Response code
    '200':
      description: Successful response
      content:
        application/json:
          schema:
            type: string

どちらについても文句をdredd言いません。

スキーマのプロパティも変更しました。

    globalSettingsName:
      type: object
      properties:
        www:
          type: string
          description: 'some description'
          example: 'somestring'
      required:
        - www

失敗すると予想される場合も、同じ (成功) 結果が得られます。

これらの検証は でサポートされていませんdreddか? 仕様を間違って使用していますか?

4

1 に答える 1