swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

JSX boolean attribute "readOnly" should not use string values

Open locomotif opened this issue 8 years ago • 2 comments

Q&A (please complete the following information)

  • OS: macOS
  • Browser: Chrome
  • Version: 69.0.3497.100 (Official Build) (64-bit)
  • Method of installation: yarn
  • Swagger-UI version: 3.19.0
  • Swagger/OpenAPI version: 3.19.0

To reproduce...

This is not necessarily a bug, but maybe a react best practice. When executing a sample rest endpoint, I am noticing a warning on the console. Please see screenshot below. The issue originates from swagger-ui/src/core/components/curl.jsx

Please note the readOnly attribute

<textarea onFocus={this.handleFocus} readOnly="true" className="curl" style={{ whiteSpace: "normal" }} value={curl}></textarea>
// ...should be
<textarea onFocus={this.handleFocus} readOnly className="curl" style={{ whiteSpace: "normal" }} value={curl}></textarea>

Expected behavior

I expect no warnings

Screenshots

image

locomotif avatar Oct 02 '18 20:10 locomotif

PR: #5497

hkosova avatar Aug 08 '19 11:08 hkosova

fixed in #5497!

shockey avatar Aug 23 '19 04:08 shockey