Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Add support for rendering default value #189

Merged
merged 4 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion demo/docs/cos/create-a-bucket.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For more information on Hyper Protect Crypto Services, [see the documentation](h
Note that managed encryption is **not** available in a Cross Region configuration and any SSE-KP buckets must be Regional.
:::

<details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"bucketName","in":"path","required":true,"schema":{"type":"string"}}}></ParamsItem></ul></div></details><details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Header Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"ibm-service-instance-id","in":"header","description":"This header references the service instance where the bucket will be created and to which data usage will be billed.","required":true,"schema":{"type":"string"}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"name":"ibm-sse-kp-encryption-algorithm","in":"header","description":"This header is used to specify the algorithm and key size to use with the encryption key stored by using Key Protect. This value must be set to the string `AES256`.","required":false,"schema":{"type":"string"}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"name":"ibm-sse-kp-customer-root-key-crn","in":"header","description":"This header is used to reference the specific root key used by Key Protect or Hyper Protect Crypto Services to encrypt this bucket. This value must be the full CRN of the root key.","required":false,"schema":{"type":"string"}}}></ParamsItem></ul></div></details><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"CreateBucketConfiguration"} required={false} schemaDescription={undefined} schemaName={"object"} qualifierMessage={undefined}></SchemaItem></ul></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
<details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"bucketName","in":"path","required":true,"schema":{"type":"string"}}}></ParamsItem></ul></div></details><details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Header Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"ibm-service-instance-id","in":"header","description":"This header references the service instance where the bucket will be created and to which data usage will be billed.","required":true,"schema":{"type":"string"}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"name":"ibm-sse-kp-encryption-algorithm","in":"header","description":"This header is used to specify the algorithm and key size to use with the encryption key stored by using Key Protect. This value must be set to the string `AES256`.","required":false,"schema":{"type":"string"}}}></ParamsItem><ParamsItem className={"paramsItem"} param={{"name":"ibm-sse-kp-customer-root-key-crn","in":"header","description":"This header is used to reference the specific root key used by Key Protect or Hyper Protect Crypto Services to encrypt this bucket. This value must be the full CRN of the root key.","required":false,"schema":{"type":"string"}}}></ParamsItem></ul></div></details><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"CreateBucketConfiguration"} required={false} schemaDescription={undefined} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></ul></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>

ok

Expand Down
2 changes: 1 addition & 1 deletion demo/docs/cos/generating-an-iam-token.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ An access token is a temporary credential that expires after 1 hour.
After the acquired token expires, you must generate a new token to continue calling IBM Cloud or service APIs, and you can perform only actions that are allowed by your level of assigned access within all accounts.
:::

<details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong><strong style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}> required</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"grant_type"} required={true} schemaDescription={undefined} schemaName={"string"} qualifierMessage={"**Possible values:** [`urn:ibm:params:oauth:grant-type:apikey`]"}></SchemaItem><SchemaItem collapsible={false} name={"apikey"} required={true} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem></ul></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
<details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong><strong style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}> required</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"grant_type"} required={true} schemaDescription={undefined} schemaName={"string"} qualifierMessage={"**Possible values:** [`urn:ibm:params:oauth:grant-type:apikey`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"apikey"} required={true} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></ul></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>

ok

Expand Down
10 changes: 5 additions & 5 deletions demo/docs/petstore/add-pet.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ Add new pet to the store inventory.

Pet object that needs to be added to the store

</div></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Pet ID"} schemaName={"int64"} qualifierMessage={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"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
</div></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Pet ID"} schemaName={"int64"} 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"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Categories this pet belongs to

</div><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Category ID"} schemaName={"int64"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Category name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"}></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"}}>
</div><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"}}>

Test Sub Category

</div><SchemaItem collapsible={false} name={"prop1"} required={false} schemaDescription={"Dumb Property"} schemaName={"string"} qualifierMessage={undefined}></SchemaItem></div></details></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaDescription={"The name given to a pet"} schemaName={"string"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"photoUrls"} required={true} schemaDescription={"The list of URL to a cute photos featuring pet"} schemaName={"url[]"} qualifierMessage={"**Possible values:** `<= 20`"}></SchemaItem><SchemaItem collapsible={false} name={"friend"} required={false} schemaDescription={undefined} schemaName={""} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>tags</strong><span style={{"opacity":"0.6"}}> Tag[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
</div><SchemaItem collapsible={false} name={"prop1"} required={false} schemaDescription={"Dumb Property"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaDescription={"The name given to a pet"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"photoUrls"} required={true} schemaDescription={"The list of URL to a cute photos featuring pet"} schemaName={"url[]"} qualifierMessage={"**Possible values:** `<= 20`"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"friend"} required={false} schemaDescription={undefined} schemaName={""} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>tags</strong><span style={{"opacity":"0.6"}}> Tag[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

**Possible values:** `>= 1`

</div><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Tags attached to the pet

</div><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Tag ID"} schemaName={"int64"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Tag name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"status"} required={false} schemaDescription={"Pet status in the store"} schemaName={"string"} qualifierMessage={"**Possible values:** [`available`, `pending`, `sold`]"}></SchemaItem><div className={"discriminatorItem"}><div><strong style={{"paddingLeft":"1rem"}}>petType</strong><span style={{"opacity":"0.6"}}> string</span><div style={{"paddingLeft":"1rem"}}>
</div><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={"Tag ID"} schemaName={"int64"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={"Tag name"} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty`"} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"status"} required={false} schemaDescription={"Pet status in the store"} schemaName={"string"} qualifierMessage={"**Possible values:** [`available`, `pending`, `sold`]"} defaultValue={undefined}></SchemaItem><div className={"discriminatorItem"}><div><strong style={{"paddingLeft":"1rem"}}>petType</strong><span style={{"opacity":"0.6"}}> string</span><div style={{"paddingLeft":"1rem"}}>

**Possible values:** [`cat`, `dog`, `bee`]

</div><div style={{"paddingLeft":"1rem"}}>

Type of a pet

</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={true} schemaDescription={"The measured skill for hunting"} schemaName={"string"} qualifierMessage={"**Possible values:** [`clueless`, `lazy`, `adventurous`, `aggressive`]"}></SchemaItem></div></TabItem><TabItem label={"dog"} value={"1-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"packSize"} required={true} schemaDescription={"The size of the pack the dog is from"} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1`"}></SchemaItem></div></TabItem><TabItem label={"bee"} value={"2-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"honeyPerDay"} required={true} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details><div><ApiTabs><TabItem label={"405"} value={"405"}><div>
</div><DiscriminatorTabs><TabItem label={"cat"} value={"0-item-discriminator"}><div style={{"marginLeft":"-4px"}}><SchemaItem collapsible={false} name={"huntingSkill"} required={true} 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={true} 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={true} schemaDescription={"Average amount of honey produced per day in ounces"} schemaName={"number"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></TabItem></DiscriminatorTabs></div></div></ul></details><div><ApiTabs><TabItem label={"405"} value={"405"}><div>

Invalid input

Expand Down
Loading