swagger-api / swagger-api/swagger-ui

readOnly attribute for a Request Body Parameter is not disabling the request body parameter.

Open
#7,673 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: support
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: macOS
  • Browser: chrome
  • Method of installation: npm
  • Swagger-UI version: latest
  • Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration

A Component refers to a Parameter with the following properties. Please note readOnly is set to true

"offset" : {
        "name" : "offset",
        "in" : "path",
        "description" : "Index of first item to return.",
        "required" : false,
        "readOnly" : true,
        "schema" : {
          "type" : "integer",
          "format" : "int32"
        }
      }

However when the same is checked in the Swagger UI, the offset field is still editable. It should be disabled based on the property readOnly

Expected behavior
Screenshots

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the supplied OpenAPI 3.0 parameter in Swagger UI, then trace the parameter form rendering and existing tests; done means a parameter with readOnly set to true is no longer editable and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.