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

Stack Overflow when null is parsed #1428

Closed
yasassri opened this issue Jun 29, 2015 · 2 comments
Closed

Stack Overflow when null is parsed #1428

yasassri opened this issue Jun 29, 2015 · 2 comments

Comments

@yasassri
Copy link

Refer the following Swagger definition, If you try to process this it will result a stackoverflow error. This is dueto the null property parsed as an Enum.

{  
   "basePath":"/mrprdep",
   "tags":[  

   ],
   "definitions":{  
      "nl.medrecord.prd.model.ehr.observation.height.v1.Event+ro":{  
         "type":"object",
         "description":"\n\nFor more information, see the [JSON schema](../schemas/objects/nl_medrecord_prd_model_ehr_observation_height_v1_Event.json) or the [Event](https://javadoc.medvision360.org/prd-api-jee/latest/latest/nl/medrecord/prd/model/ehr/observation/height/v1/Event.html) class in the Javadoc.",
         "required":[  
            "time",
            "data"
         ],
         "properties":{  
            "time":{  
               "format":"date-time",
               "type":"string",
               "description":"The time of the event.",
               "enum":[  
                  "STANDING",
                  "LYING",
                  null,
                  "RECLINING",
                  "LYING_WITH_TILT_TO_LEFT"
               ],
               "example":"2014-03-21T21:44Z",
               "title":"Time"
            },
            "data":{  
               "description":"The data of the event.",
               "$ref":"#/definitions/nl.medrecord.prd.model.ehr.observation.height.v1.Data+ro"
            }
         }
      }
   },
   "info":{  
      "version":"1.0.0-SNAPSHOT",
      "title":"MedRecord API",
      "x-advanced":"ehrehrIdcomposition"
   },
   "swagger":"2.0",
   "paths":{  
      "/ehr":{  
         "get":{  
            "parameters":[  
               {  
                  "type":"string",
                  "description":"Authorization token.",
                  "in":"query",
                  "name":"authToken",
                  "default":"helloletmeinplease"
               }
            ],
            "description":"This method lists all Content",
            "tags":[  
               "ehr"
            ],
            "summary":"List all available EHRs",
            "responses":{  
               "503":{  
                  "description":"The service is unavailable. Please try again later.",
                  "schema":{  
                     "$ref":"com.medvision360.lib.api.exceptions.server.ServiceUnavailableException"
                  }
               }
            }
         }
      }
   }
}

I was able to fix this in the following manner. Please fix this issue.
swagger-api/swagger-js#512

@webron
Copy link
Contributor

webron commented Jul 5, 2015

While errors should be more graceful, null is not a valid value in Swagger definitions.
Have a look at swagger-api/swagger-js#507.

@fehguy
Copy link
Contributor

fehguy commented Dec 9, 2015

closing as downstream issue was resolved.

@fehguy fehguy closed this as completed Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants