Discussions
Nested Discriminator support
Hey Readme.io community
I would like to know how I can achieve nested discriminator oneOf -> oneOf nested.
When I have a nested oneOf property it does not take first discriminator for "channel"
![](https://files.readme.io/8cea777-Screenshot_2024-02-09_at_13.06.08.png)
![](https://files.readme.io/260ebad-Screenshot_2024-02-09_at_13.06.21.png)
Example Code
```json
"oneOf": [
{
"$ref": "#/components/schemas/TemplateSMSPostRequestDto"
},
{
"$ref": "#/components/schemas/TemplateViberPostRequestDto"
}
],
"discriminator": {
"propertyName": "channel",
"mapping": {
"SMS": "#/components/schemas/TemplateSMSPostRequestDto",
"VIBER": "#/components/schemas/TemplateViberPostRequestDto"
}
}
```
TemplateSMSPostRequestDto
```json
{
"title": "SMS Template",
"type": "object",
"required": [
"text",
"channel"
],
"properties": {
"channel": {
"type": "string"
},
"text": {
"type": "string",
"maxLength": 1000
}
}
}
```
TemplateViberPostRequestDto
```json
{
"title": "Viber Template",
"type": "object",
"allOf": [
{
"required": [
"channel"
],
"properties": {
"channel": {
"type": "string"
}
}
},
{
"oneOf": [
{
"$ref": "#/components/schemas/TemplateViberImagePostRequestDto"
},
{
"$ref": "#/components/schemas/TemplateViberDocumentPostRequestDto"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"image": "#/components/schemas/TemplateViberImagePostRequestDto",
"document": "#/components/schemas/TemplateViberDocumentPostRequestDto"
}
}
}
]
}
```
TemplateViberImagePostRequestDto
```json
{
"title": "Image Template",
"type": "object",
"required": [
"type",
"channel"
],
"properties": {
"type": {
"type": "string"
},
"text": {
"type": "string"
},
"url": {
"type": "string",
"description": "One of 'url' or 'media_id' is required"
},
"media_id": {
"type": "string",
"format": "uuid",
"description": "One of 'url' or 'media_id' is required"
}
}
}
```
TemplateViberDocumentPostRequestDto
```json
{
"title": "Document Template",
"type": "object",
"required": [
"type",
"filename",
"channel"
],
"properties": {
"type": {
"type": "string"
},
"filename": {
"type": "string"
},
"url": {
"type": "string"
},
"media_id": {
"type": "string",
"format": "uuid"
}
}
}
```
Posted by Eduard Isakhanyan 2 months ago
Reusable content does not show in TOC
Hi
Each page under **Guides** shows a small **table of contents** (_top, right_), based on the **page headings**.
I notice, however, that headings from a **reusable content snippet** do **not** show up there.
Is that something that Readme is planning to address?
**Motivation**:
Sometimes, we want to create a chunk of reusable content that includes headings. But bc of this limitation, we are forced to break it into smaller chunks, and leave the headings as fixed text.
Thanks
PS: The reusable content is a _very_ welcome feature. Great job! 👍
Posted by Peter Cimring 2 months ago
Recover deleted API reference page
I deleted an API reference page as I generated a new one using a different schema for the endpoints. But the old page had manual docs explaining each of the response fields and is now gone. I need these same docs fo the new page. Any way that you can recover this for me ? It just happened less than an hour ago.
Posted by Enrique Goyret 2 months ago
Segment Integration sends wrong data
Hi
The readme/segment integration sends the `page path` as the "category" name.
Any chance to adjust send the actual Category Name?
```javascript
analytics.page('/docs/what-is-anytrack', 'What is AnyTrack?', {
category: '/docs/what-is-anytrack',
context: {
plugin: {
name: 'readme_io',
version: '1.0.0'
}
},
name: 'What is AnyTrack?',
path: '/docs/what-is-anytrack',
referrer: '',
search: '?_cio_id=d6a4050080df0182df01&ajs_aid=d6a4050080df0182df01&ajs_event=Clicked%2520Email&ajs_prop_emailCampaign=Free+trial&ajs_uid=PpouT09lhq&atclid=p8qkMansHXKGxAZjAgbldrxzDSq53R&utm_campaign=Free+trial&utm_content=Unusual+welcome+Email+%28Samuel+Edit%29&utm_id=30&utm_marketing_tactic=email_action&utm_medium=email&utm_source=customer.io',
title: 'What is AnyTrack?',
url: 'https://readme.anytrack.io/docs/what-is-anytrack'
});
```
Posted by Laurent 2 months ago
How can we implement additional Level of Sidebar Nesting in readMe
Is there any documentation link that explains how we can add Additional Level of Sidebar Nesting in openAPI specification in readMe. Or is there any link of example for this.
Posted by Rupika Mahajan 3 months ago
Cannot set a Plan
I've been trying to select a plan for my project after my free trial expired. Selecting the free plan, for instance, causes a 400 error:
```Text javascript
{
"success": false,
"errors": {
"ValidationError": "Validation Failed",
"appearance.colorScheme": "`auto` is not a valid enum value for path `appearance.colorScheme`."
}
}
```
![](https://files.readme.io/ba0660e-image.png)
How should I resolve this?
Posted by Jeremy B 3 months ago
How do we change our name from `null` in discussions when logged in?
I understand we can edit our profile via the readme.com dashboard but this does not change the name in when posting in discussions (currently null). Anyone know how to set our default name for all README discussions?
Thank you in advance!
Posted by null 3 months ago
Boolean enums always set to `true`
In writing OpenAPI files, when I want to enforce a fixed value for some key, I use an enum with a single item, as such:
```
ExampleSchema01:
type: object
properties:
FixedValueProperty:
type: string
enum:
- "This is the only possible value for FixedValueProperty."
```
However, when I try doing the same for boolean values, the Readme API reference section always renders it as `true`, even if the enum specifies `false` as the only possible value.
For example:
```
ExampleSchema02:
type: object
properties:
FixedBooleanTrue:
type: boolean
enum:
- true
FixedBooleanFalse:
type: boolean
enum:
- false
```
Readme's API reference section will render both `FixedBooleanTrue` and `FixedBooleanFalse` as enums with `true` and the only possible value.
Why is that? How can I fix this? Is there a workaround?
Posted by Tom Zandman 3 months ago
Try now button
I have imported a OAS file which automatically enabled Try Now button for all endpoints. I understood that I can can turn it off by setting the OpenAPI extension x-explorer-enabled to false. But, with the design our documentation page will be visible to everyone, regardless logged in or not. So I am curious how to handle the case when users not signed in yet my platform so no api key can be retrieved.
Posted by Pavel 3 months ago
Changing badges in API reference
Hi there,
I'm happy that support for webhooks has been added to the API reference.
However, it seems like the 'badges' (not sure if this is the right name) for the pages in the left nav don't reflect the page type:
![](https://files.readme.io/dfc0f9f-image.png)
As you can see, you get a **WBHK** badge on the actual page, but a **POST** badge in the left nav. Could this be updated?
It's possible it's a mistake on our end, but rendering a preview server using redocly shows the correct badges, so this doesn't seem likely.
Thanks!
Tom
Posted by Thomas Harrington 3 months ago