Prompt

Why is my Swagger docs page missing request examples?

Technology / Documentation Tools1 observationLast seen Oct 16, 2026

Latest observation

Oct 16, 2026OpenAI APIWeb search: off

A Swagger UI page can miss request examples for a few common reasons:

  1. Your OpenAPI spec doesn’t define them

    • Swagger UI only shows examples if they’re present in the schema, request body, or parameters.
    • In OpenAPI, that usually means using:
      • example
      • examples
      • schema.example
      • requestBody.content...examples
  2. You’re using default instead of example

    • default describes a fallback value, but Swagger UI often won’t render it as a request example.
    • Use example for visible sample data.
  3. The request body schema is too vague

    • If your body is just type: object with no properties/examples, Swagger UI has little to display.
    • Add property-level examples or a full body example.
  4. Your framework isn’t generating examples automatically

    • Some tools generate OpenAPI docs from code annotations, but they won’t infer examples unless you explicitly add them.
    • Examples may need decorators/attributes like:
      • NestJS: @ApiBody({ examples: ... })
      • Springdoc/OpenAPI annotations
      • Swashbuckle/NSwag annotations
      • FastAPI Body(..., example=...)
  5. You’re looking at a parameter example, not a JSON body example

    • Query/path/header parameters use example on the parameter.
    • Request bodies use requestBody.content.application/json.example(s).
  6. Swagger UI version/limitations

    • Older Swagger UI versions may not display multiple examples as expected.
    • Sometimes examples are present in the spec, but the UI only shows one or renders them differently.

What to check

  • Open the raw OpenAPI JSON/YAML and search for example or examples.
  • If they’re absent, add them in your API documentation annotations or spec.
  • If they’re present, verify the UI version and whether the example is attached to the correct section.

Example OpenAPI request body

requestBody:
  required: true
  content:
    application/json:
      schema:
        $ref: '#/components/schemas/CreateUserRequest'
      examples:
        basic:
          value:
            name: "Alice"
            email: "alice@example.com"

If you want, I can help you debug this for your specific stack (NestJS, Spring Boot, FastAPI, .NET, etc.) if you paste your OpenAPI snippet or controller code.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.