swagger-ui
swagger-ui copied to clipboard
JSX boolean attribute "readOnly" should not use string values
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

PR: #5497
fixed in #5497!