Skip to content

Swagger Try it out: render request-body properties as form fields #28

Closed

Description

@Neup123

Problem

Swagger UI's "Try it out" renders JSON request bodies as one JSON editor. It only renders path/query/header parameters such as instanceName as separate input controls. Users want each request-body field exposed as its own labeled UI input.

Current state

The runtime OpenAPI document already contains per-property JSON Schemas, required fields, types, enums, bounds, and descriptions. This is not fixed by adding more schema annotations or toggling a standard Swagger UI option: upstream Swagger UI intentionally edits an application/json request body as one JSON value.

Required design

Add a custom request-body form renderer/plugin (or a separate API explorer) that:

  • recursively renders object properties as controls
  • supports required/optional fields, booleans, numbers, enums, arrays, nested objects, nullable values, patterns, bounds, examples, and oneOf/anyOf
  • serializes the controls back to the exact JSON request body
  • preserves the existing authorization, path parameters, response display, and normal JSON editor as an advanced/fallback mode
  • works across all runtime-generated routes rather than hardcoding individual methods

Acceptance criteria

  • instanceName remains a path field
  • request-body properties appear as labeled controls for representative simple and nested routes
  • controls respect schema validation and descriptions
  • generated request JSON is identical to the documented body
  • raw JSON remains available
  • automated UI regression coverage exists for representative schemas

This is separate from missing schemas: the schemas are present; the missing piece is a custom Swagger UI renderer.

Activity

  1. Neup123 commented on Sep 22, 2026

    @Neup123
    OwnerAuthor

    This is now part of the delete-message follow-up. The runtime schemas are present, but standard application/json Swagger UI still shows one editor. I am adding a guided form media type generated from the same schema, keeping application/json as the advanced fallback, and adding contract checks so enums and individual fields remain available instead of regressing to an untyped Request body.

  2. Neup123 commented on Sep 22, 2026

    @Neup123
    OwnerAuthor

    Delivered in #32 and Evolution API v5.4.3.

    Runtime Swagger request bodies now expose application/x-www-form-urlencoded as the guided field-based form and retain application/json as the advanced raw-body option. Recursive form-body coercion covers booleans, numbers, arrays, and nested objects before normal schema validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions