Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

"Fixed" type attribute should propagate to an empty object member #686

@Ge11ert

Description

@Ge11ert

I'm running on v. 4.0.0-pre.4.

According to MSON Spec, fixed type attribute should propagate to nested members.

First example:

# My API

# Request [GET /first]

+ Response 200 (application/json)
    + Attributes
        + result (object, fixed)
            + obj_member (object)

produces the following schema:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "properties": {
        "obj_member": {
          "type": "object"
        }
      },
      "required": [
        "obj_member"
      ],
      "additionalProperties": false
    }
  }
}

Second example (obj_member has explicit fixed attribute)

# My API

# Request [GET /first]

+ Response 200 (application/json)
    + Attributes
        + result (object, fixed)
            + obj_member (object, fixed)

produces this (obj_member has field "additionalProperties": false now) :

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "properties": {
        "obj_member": {
          "type": "object",
          "additionalProperties": false
        }
      },
      "required": [
        "obj_member"
      ],
      "additionalProperties": false
    }
  }
}

Expected behaviour:
These 2 examples should generate the same json-schema.

P.S. If obj_member has any nested properties, fixed attribute propagation works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions