Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Support for allOf and a host of small improvements and bug fixes #436

Merged
merged 54 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7c37976
feat: moving react-jsonschema-form off our fork and to the mainline pkg
erunion Jan 11, 2020
052fae1
docs: wip updates to the allOf example definition
erunion Jan 11, 2020
46bf3e3
Merge branch 'master' into feat/mainline-rjsf
erunion Jan 31, 2020
a339bdd
Merge branch 'master' into feat/mainline-rjsf
erunion Jan 31, 2020
bd0c3f8
Merge branch 'master' into feat/mainline-rjsf
erunion Feb 13, 2020
d830bd9
chore(deps): pointing rjsf towards our new soft fork
erunion Feb 14, 2020
950a0c5
test: updating our allOf example document
erunion Feb 14, 2020
28cd456
feat: adding support for `format: blob` to render a string textarea
erunion Feb 14, 2020
607d1b2
feat: adding support for rendering a textarea on `format: html`
erunion Feb 14, 2020
ee06556
fix: html and blob formats now have the right format pill next to them
erunion Feb 14, 2020
e8b8e1c
Merge branch 'master' into feat/mainline-rjsf
erunion Feb 27, 2020
9bc9f2e
chore: re-running npm install to fix some dep merge issues
erunion Feb 27, 2020
374c785
Merge branch 'master' into feat/mainline-rjsf
erunion Feb 27, 2020
d086c75
chore(deps): upgrading @readme/react-jsonschema-form to 1.1.0
erunion Feb 27, 2020
85f49e2
Merge branch 'master' into feat/mainline-rjsf
erunion Feb 28, 2020
37ce218
Merge branch 'master' into feat/mainline-rjsf
erunion Mar 2, 2020
79deea2
test: cleanup on the github workflow
erunion Mar 2, 2020
2a70eef
test: workflow updates
erunion Mar 2, 2020
c2d997d
test: reverting workflow changes
erunion Mar 2, 2020
6fd5063
docs: merging our three polymorphism example docs into a single file
erunion Mar 2, 2020
8394dd9
fix: fixing a bug where long flattened response bodies would be hidden
erunion Mar 2, 2020
39b411c
docs: adding a comment in the SchemaField explaining bool handling
erunion Mar 2, 2020
2a5f129
fix: updating word wrapping on response schemas
erunion Mar 2, 2020
808c4e0
chore: minor cleanup of the root package file
erunion Mar 3, 2020
be77055
chore: updating package-lock files
erunion Mar 4, 2020
524670b
test: moving test fixtures into a __fixtures__ directory
erunion Mar 5, 2020
221ec07
test: resolving some broken Doc tests
erunion Mar 5, 2020
3c5dc49
docs: removing some duplicated properties from the oas fixture
erunion Mar 5, 2020
3c889af
test: fixing some broken custom string format tests
erunion Mar 5, 2020
08d8ace
fix: adding support for being able to handle escaped refs
erunion Mar 5, 2020
92a0fc0
test: dumping jest-transform-css for another library to fix css issue…
erunion Mar 5, 2020
675110d
test: fixing some broken tests
erunion Mar 5, 2020
d441e73
test: making sure to run `npm run update:examples` before tests
erunion Mar 5, 2020
c13b846
chore(deps): upgrading @readme/oas-tooling to 3.0.0
erunion Mar 6, 2020
cd441b3
test: fixing a comment
erunion Mar 6, 2020
4e46e2e
fix: removing some hokey environment checks for scss loading
erunion Mar 6, 2020
e428baa
Merge branch 'master' into feat/mainline-rjsf
erunion Mar 10, 2020
636523b
fix: wrapping oneOf and anyOf schemas in a custom template shell
erunion Mar 11, 2020
770c2b3
test: fixing a busted Doc test
erunion Mar 11, 2020
99fffb0
fix: if an operation doesn't have an operationId, generate a unique one
erunion Mar 11, 2020
aa09e57
docs: adding a cyclical refs example document
erunion Mar 11, 2020
9dbd064
fix: patching a bug where we couldn't handle nested $refs in oneOf
erunion Mar 11, 2020
3923574
chore(deps): upgrading @readme/react-jsonschema-form to 1.1.1
erunion Mar 11, 2020
f5794bf
feat: improved error messaging functionality (#517)
erunion Mar 11, 2020
e0a0ca0
docs: updating the readme
erunion Mar 11, 2020
51740d7
style: autoprefix scss
rafegoldberg Mar 11, 2020
ec12f75
Merge branch 'master' into feat/mainline-rjsf
erunion Mar 12, 2020
a0d2b5c
chore: updating lock files post-bootstrap
erunion Mar 12, 2020
7172428
Merge branch 'feat/mainline-rjsf' of github.com:readmeio/api-explorer…
erunion Mar 12, 2020
7a5145b
fix: cleaning up the new "experiment" options in the demo build
erunion Mar 12, 2020
78391df
feat: adding a new experiment toggle for the new markdown engine
erunion Mar 12, 2020
e1c2dcc
fix: adding back a form id that i renamed/fixed
erunion Mar 12, 2020
16cdd64
fix: stop generating random ids when an operationId isn't present
erunion Mar 12, 2020
02056ec
fix: renaming `onGroupChange` to `onAuthGroupChange`
erunion Mar 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This repo consists of the following npm modules:

- [@readme/api-explorer](https://npm.im/@readme/api-explorer) - the React components that make up the explorer
- [@readme/markdown](https://npm.im/@readme/markdown) - the markdown parser
- [@readme/markdown-magic](https://npm.im/@readme/markdown-magic) - the legacy "magic block"-based markdown parser
- [@readme/oas-extensions](https://npm.im/@readme/oas-extensions) - an exported object of our [OAS extensions](https://docs.readme.com/docs/swagger-extensions)
- [@readme/oas-to-har](https://npm.im/@readme/oas-to-har) - utility to transform an OAS operation into a HAR representation
- [@readme/syntax-highlighter](https://npm.im/@readme/syntax-highlighter) - the syntax highlighter in use on ReadMe
Expand Down
145 changes: 94 additions & 51 deletions example/src/Demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,58 +14,101 @@ require('../../example/swagger-files/response-schemas.json');

require('../../packages/api-logs/main.css');

function Demo({ fetchSwagger, status, docs, oas, oauth }) {
return (
<div>
<div className="api-list-header">
<ApiList fetchSwagger={fetchSwagger} />
<pre>{status.join('\n')}</pre>
class Demo extends React.Component {
erunion marked this conversation as resolved.
Show resolved Hide resolved
constructor(props) {
super(props);
this.state = {
brokenExplorerState: false,
maskErrorMessages: false,
};

this.toggleBrokenState = this.toggleBrokenState.bind(this);
this.toggleErrorMasking = this.toggleErrorMasking.bind(this);
}

toggleErrorMasking(e) {
this.setState({ maskErrorMessages: e.target.checked });
this.forceUpdate();
}

toggleBrokenState(e) {
this.setState({ brokenExplorerState: e.target.checked });
this.forceUpdate();
}

render() {
const { fetchSwagger, status, docs, oas, oauth } = this.props;
const { brokenExplorerState, maskErrorMessages } = this.state;

const additionalProps = {};
if (!brokenExplorerState) {
additionalProps.oasFiles = {
'api-setting': Object.assign(extensions.defaults, oas),
};
}

return (
<div>
<div className="api-list-header">
<ApiList fetchSwagger={fetchSwagger} />

{status.length > 0 ? (
<pre>{status.join('\n')}</pre>
) : (
<p>
<input checked={maskErrorMessages} onChange={this.toggleErrorMasking} type="checkbox" /> Mask error
messages? &nbsp;
<input checked={brokenExplorerState} onChange={this.toggleBrokenState} type="checkbox" /> Show fully
broken state
</p>
)}
</div>

{status.length === 0 && (
<ApiExplorer
{...additionalProps}
// Uncomment this in for column layout
// appearance={{ referenceLayout: 'column' }}
appearance={{ referenceLayout: 'row' }}
// Uncomment this if you want to test enterprise-structured URLs
// baseUrl={'/child/v1.0'}
baseUrl="/"
// To test the top level error boundary, uncomment this
// docs={[null, null]}
docs={docs}
// We only really set this to `true` for testing sites for errors using puppeteer
dontLazyLoad={false}
flags={{ correctnewlines: false }}
glossaryTerms={[{ term: 'apiKey', definition: 'This is a definition' }]}
Logs={Logs}
maskErrorMessages={maskErrorMessages}
oauth={oauth}
suggestedEdits
variables={{
// Uncomment this to test without logs
// user: {}
// Uncomment this to test with logs
// user: {
// keys: [
// { id: 'someid', name: 'project1', apiKey: '123' },
// { id: 'anotherid', name: 'project2', apiKey: '456' },
// ],
// },
// Uncomment this to test without keys array
// user: { user: '123456', pass: 'abc', apiKey: '123456' },
user: {
keys: [
{ id: 'asdfghjkl', name: 'project1', apiKey: '123', user: 'user1', pass: 'pass1' },
{ id: 'zxcvbnm', name: 'project2', apiKey: '456', user: 'user2', pass: 'pass2' },
],
},
defaults: [],
}}
/>
)}
</div>
{status.length === 0 && (
<ApiExplorer
// Uncomment this in for column layout
// appearance={{ referenceLayout: 'column' }}
appearance={{ referenceLayout: 'row' }}
// Uncomment this if you want to test enterprise-structured URLs
// baseUrl={'/child/v1.0'}
baseUrl="/"
// To test the top level error boundary, uncomment this
// docs={[null, null]}
docs={docs}
// We only really set this to `true` for testing sites for errors using puppeteer
dontLazyLoad={false}
flags={{ correctnewlines: false }}
glossaryTerms={[{ term: 'apiKey', definition: 'This is a definition' }]}
Logs={Logs}
oasFiles={{
'api-setting': Object.assign(extensions.defaults, oas),
}}
oauth={oauth}
suggestedEdits
variables={{
// Uncomment this to test without logs
// user: {}
// Uncomment this to test with logs
// user: {
// keys: [
// { id: 'someid', name: 'project1', apiKey: '123' },
// { id: 'anotherid', name: 'project2', apiKey: '456' },
// ],
// },
// Uncomment this to test without keys array
// user: { user: '123456', pass: 'abc', apiKey: '123456' },
user: {
keys: [
{ id: 'asdfghjkl', name: 'project1', apiKey: '123', user: 'user1', pass: 'pass1' },
{ id: 'zxcvbnm', name: 'project2', apiKey: '456', user: 'user2', pass: 'pass2' },
],
},
defaults: [],
}}
/>
)}
</div>
);
);
}
}

Demo.propTypes = {
Expand Down
78 changes: 0 additions & 78 deletions example/swagger-files/all-of.json

This file was deleted.

78 changes: 0 additions & 78 deletions example/swagger-files/any-of.json

This file was deleted.

75 changes: 0 additions & 75 deletions example/swagger-files/circular.json

This file was deleted.

Loading