Ask a Question

yaml resolved

ELANA
New Contributor

yaml resolved

I try to export API-  by use download API  as "YAML Resolved"  the file that SWAGGERHUB generate  was without  nullable: true in object.

how can i fix it?

 

 

example:

ELANA_0-1695211344772.png

ELANA_1-1695211408113.png

 

4 REPLIES 4
chichepo
Champion Level 3

Hi @ELANA  😉

Can you provide the content of the reference LoanOfferResponse_data ?

ELANA
New Contributor

Hi Eli 😉

yes,

ELANA_0-1695271316336.png

tnk you

chichepo
Champion Level 3

@ELANA 
Well, that's quite weird.

LoanOfferResponse_data does not seems to be explicitly nullable.
so, it seems that some bad definition exists somewhere in your file and you will have to debug it.

Try to play with the nullable definition as following:

Object explicitly nullable you should get after resolve
chichepo_0-1695278692472.png chichepo_1-1695278784837.png
Object explicitly NOT nullable you should get after resolve
chichepo_2-1695278879872.png chichepo_3-1695278923004.png

 

It should help in debugging the issue

Let us know

abeermalik
New Contributor

To ensure that your Swagger definition includes "nullable: true" for objects when exporting it as "YAML Resolved" from SwaggerHub, you can follow these steps:

1. Open your Swagger definition in SwaggerHub.

2. Locate the objects or properties where you want to set "nullable: true."

3. Edit the Swagger definition, and for each object or property, explicitly set "nullable: true." For example:

```yaml
properties:
someProperty:
type: string
nullable: true
```

4. Save your changes.

5. Export the API as "YAML Resolved" again.

By manually setting "nullable: true" for the objects or properties in your Swagger definition, you ensure that it is included in the exported YAML file as you intended. This should address the issue you described.

cancel
Showing results for 
Search instead for 
Did you mean: