Search code examples
swaggeropenapiswagger-2.0

Is it valid to define an object without any sub-properties in OpenAPI 2.0 (Swagger 2.0)?


Is the following OpenAPI definintion valid?

        "settings": {
          "type": "object",
          "description": "Json formatted public settings for the extension."
        },

It's defined as object but has no sub-properties.


Solution

  • Yes, this definition is valid and means that settings is a free-form object, that is, it can have arbitrary properties or be an empty object.