10openapi-petstore

command
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 9 Imported by: 0

README

openapi-petstore

$ http :8080/pets
HTTP/1.1 200 OK
Content-Length: 13
Content-Type: application/json; charset=utf-8
Date: Mon, 18 Jul 2022 16:16:04 GMT

{
    "items": []
}

post

$ echo '{"name": "foo"}' | http :8080/pets
HTTP/1.1 200 OK
Content-Length: 20
Content-Type: application/json; charset=utf-8
Date: Mon, 18 Jul 2022 16:16:55 GMT

{
    "id": "",
    "name": "" 
}

validation error

$ echo '{}' | http :8080/pets
HTTP/1.1 400 Bad Request
Content-Length: 553
Content-Type: application/json; charset=utf-8
Date: Mon, 18 Jul 2022 16:17:30 GMT

{
    "code": 400,
    "detail": [
        "request body has an error: doesn't match the schema: Error at \"/name\": property \"name\" is missing",
        "Schema:",
        "  {",
        "    \"additionalProperties\": false,",
        "    \"properties\": {",
        "      \"name\": {",
        "        \"type\": \"string\"",
        "      },",
        "      \"tag\": {",
        "        \"type\": \"string\"",
        "      }",
        "    },",
        "    \"required\": [",
        "      \"name\"",
        "    ],",
        "    \"type\": \"object\"",
        "  }",
        "",
        "Value:",
        "  {}",
        ""
    ],
    "error": "request body has an error: doesn't match the schema: Error at \"/name\": property \"name\" is missing"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL