ELANA
2 years agoNew 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:
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:
Hi Eli ๐
yes,
tnk you
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 |
Object explicitly NOT nullable | you should get after resolve |
It should help in debugging the issue
Let us know
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.