Forum Discussion

ELANA's avatar
ELANA
New Contributor
7 months ago

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:

 

4 Replies

  • chichepo's avatar
    chichepo
    Champion Level 3

    Hi ELANA  πŸ˜‰

    Can you provide the content of the reference LoanOfferResponse_data ?

      • chichepo's avatar
        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
        Object explicitly NOT nullable you should get after resolve

         

        It should help in debugging the issue

        Let us know

  • abeermalik's avatar
    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.