v1.2 Semantic Validation #1

whitlockjc opened this Issue Jun 17, 2014 · 3 comments


None yet

2 participants


We need to do more than just structural validation of the Swagger files:

***** The validation requires both the resource listing file and the API declaration/resource files


  • Ensure model ids are unique
  • Ensure model references point to defined models
  • Ensure model subTypes are not cyclical
  • Ensure model subTypes do not override inherited properties
  • Ensure model subTypes do not reference multiple "parent" objects (multiple inheritance)
  • Ensure model required properties actually exist on the model object
  • Ensure model discriminator property exists
  • Ensure API operation nicknames are unique (within a single apiDeclaration/resource)
  • Ensure API operation authorization references point to defined authorization *****
  • Ensure API operation authorization scopes (oauth 2 only) point to a defined scope *****
  • Ensure API operation method is unique
  • Ensure API operation responseMessages respond with unique response code
  • Ensure resource listing paths point to defined apiDeclaration/resource *****
  • Ensure the defaultValue of a parameter is within its type constraints


  • Declared but unreferenced authorization *****
  • Declared but unreferenced authorization scope *****
  • Declared but unreferenced model
  • Duplicate entries for model subTypes
  • Mismatched Swagger version across an API *****
  • API operation summary is greater than 120 characters
webron commented Jun 18, 2014

Regarding the defaultValue, the same would apply to minimum and/or maximum.
Another thing you can check regarding the defaultValue is that its type corresponds with the type+format fields. Not sure if the JSON Schema currently checks this, not sure if it can.


Thanks Ron, that helped a lot. I went back and updated the issue to reflect.


Based on what is known right now, this issue is complete. Please file bugs/enhancements related to semantic validation as new issues.

@whitlockjc whitlockjc closed this Jul 11, 2014
This was referenced Jul 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment