{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ivans/json-schema/ivans-market-credential-create-request-schema.json",
  "title": "MarketCredentialCreateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ivans-market-credentials-api-openapi.yml#/components/schemas/MarketCredentialCreateRequest",
  "type": "object",
  "properties": {
    "marketConfiguration": {
      "type": "string",
      "format": "uuid"
    },
    "user": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "accessStructures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MarketStructureRequest"
      }
    },
    "nickname": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "username": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "credential": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "default": {}
    }
  },
  "required": [
    "accessStructures",
    "marketConfiguration",
    "nickname",
    "user",
    "username"
  ],
  "$defs": {
    "MarketStructureRequest": {
      "type": "object",
      "properties": {
        "agency": {
          "type": "string",
          "format": "uuid"
        },
        "branch": {
          "type": "string",
          "format": "uuid"
        },
        "department": {
          "type": "string",
          "format": "uuid"
        },
        "businessUnit": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "agency"
      ]
    }
  }
}