Skip to content

Commit becd0ae

Browse files
authored
[Bug] Delete writeOnly props instead of readOnly and ignore example if present (#251)
* Delete writeOnly props instead of readOnly and ignore example if present * Re-gen API docs
1 parent 066b0a8 commit becd0ae

22 files changed

+44
-42
lines changed

demo/docs/petstore/find-pets-by-status.api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Tags attached to the pet
4848

4949
Type of a pet
5050

51-
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"[\n {\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\",\n \"sub\": {\n \"prop1\": \"string\"\n }\n },\n \"name\": \"Guru\",\n \"photoUrls\": [\n \"string\"\n ],\n \"friend\": {},\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"available\",\n \"petType\": {\n \"huntingSkill\": \"adventurous\"\n }\n }\n]"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem><TabItem label={"application/xml"} value={"application/xml"}><SchemaTabs groupId={"schema-tabs"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong><span style={{"opacity":"0.6"}}> array</span></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={undefined} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>category</strong><span style={{"opacity":"0.6"}}> Category</span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Category ID"} schemaName={"int64"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Category name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>sub</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
51+
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"[\n {\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\",\n \"sub\": {\n \"prop1\": \"string\"\n }\n },\n \"name\": \"string\",\n \"photoUrls\": [\n \"string\"\n ],\n \"friend\": {},\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"available\",\n \"petType\": {\n \"huntingSkill\": \"lazy\"\n }\n }\n]"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem><TabItem label={"application/xml"} value={"application/xml"}><SchemaTabs groupId={"schema-tabs"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong><span style={{"opacity":"0.6"}}> array</span></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={undefined} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>category</strong><span style={{"opacity":"0.6"}}> Category</span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Category ID"} schemaName={"int64"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Category name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>sub</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
5252

5353
Test Sub Category
5454

@@ -68,7 +68,7 @@ Tags attached to the pet
6868

6969
Type of a pet
7070

71-
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"<0>\n <id>0</id>\n <category>\n <id>0</id>\n <name>string</name>\n <sub>\n <prop1>string</prop1>\n </sub>\n </category>\n <name>Guru</name>\n <photoUrls>string</photoUrls>\n <friend/>\n <tags>\n <id>0</id>\n <name>string</name>\n </tags>\n <status>available</status>\n <petType>\n <huntingSkill>adventurous</huntingSkill>\n </petType>\n</0>"} language={"xml"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
71+
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"<0>\n <id>0</id>\n <category>\n <id>0</id>\n <name>string</name>\n <sub>\n <prop1>string</prop1>\n </sub>\n </category>\n <name>string</name>\n <photoUrls>string</photoUrls>\n <friend/>\n <tags>\n <id>0</id>\n <name>string</name>\n </tags>\n <status>available</status>\n <petType>\n <huntingSkill>lazy</huntingSkill>\n </petType>\n</0>"} language={"xml"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
7272

7373
Invalid status value
7474

demo/docs/petstore/find-pets-by-tags.api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Tags attached to the pet
5252

5353
Type of a pet
5454

55-
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"[\n {\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\",\n \"sub\": {\n \"prop1\": \"string\"\n }\n },\n \"name\": \"Guru\",\n \"photoUrls\": [\n \"string\"\n ],\n \"friend\": {},\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"available\",\n \"petType\": {\n \"huntingSkill\": \"adventurous\"\n }\n }\n]"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem><TabItem label={"application/xml"} value={"application/xml"}><SchemaTabs groupId={"schema-tabs"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong><span style={{"opacity":"0.6"}}> array</span></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={undefined} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>category</strong><span style={{"opacity":"0.6"}}> Category</span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Category ID"} schemaName={"int64"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Category name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>sub</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
55+
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"[\n {\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\",\n \"sub\": {\n \"prop1\": \"string\"\n }\n },\n \"name\": \"string\",\n \"photoUrls\": [\n \"string\"\n ],\n \"friend\": {},\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"available\",\n \"petType\": {\n \"huntingSkill\": \"lazy\"\n }\n }\n]"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem><TabItem label={"application/xml"} value={"application/xml"}><SchemaTabs groupId={"schema-tabs"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong><span style={{"opacity":"0.6"}}> array</span></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={undefined} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>category</strong><span style={{"opacity":"0.6"}}> Category</span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Category ID"} schemaName={"int64"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Category name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>sub</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
5656

5757
Test Sub Category
5858

@@ -72,7 +72,7 @@ Tags attached to the pet
7272

7373
Type of a pet
7474

75-
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"<0>\n <id>0</id>\n <category>\n <id>0</id>\n <name>string</name>\n <sub>\n <prop1>string</prop1>\n </sub>\n </category>\n <name>Guru</name>\n <photoUrls>string</photoUrls>\n <friend/>\n <tags>\n <id>0</id>\n <name>string</name>\n </tags>\n <status>available</status>\n <petType>\n <huntingSkill>adventurous</huntingSkill>\n </petType>\n</0>"} language={"xml"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
75+
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={false} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"} defaultValue={"lazy"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={false} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"} defaultValue={1}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={false} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"<0>\n <id>0</id>\n <category>\n <id>0</id>\n <name>string</name>\n <sub>\n <prop1>string</prop1>\n </sub>\n </category>\n <name>string</name>\n <photoUrls>string</photoUrls>\n <friend/>\n <tags>\n <id>0</id>\n <name>string</name>\n </tags>\n <status>available</status>\n <petType>\n <huntingSkill>lazy</huntingSkill>\n </petType>\n</0>"} language={"xml"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
7676

7777
Invalid tag value
7878

0 commit comments

Comments
 (0)