Migration of the route GET /v2/schemas/{resource}/{localeOrCountry} to GET /v3/schemas/{resource}/{localeOrCountry}

  • Obsolète
  • 30 mai 2025
  • 1 route liée

Context

Upgrade from GET - ​/v2/schemas/{resource}/{localeOrCountry} to GET - ​/v3/schemas/{resource}/{localeOrCountry}

3 Key benefits :

  • Renaming of the fields states_or_district.$values to field states_or_district.x-choices, and $meta to x-meta to match the json schema validator standard
  • Standardize the schema travel_documents issue_date property to issuing_date to match the PUT /v3/proposals/{proposal_id}/attendees issuing_date field naming + new pattern for authority field
  • Specify the expected identity type + add pattern to identity number + change of identity description

Impacts

Route to call :

  • GET - ​/v3/schemas/{resource}/{localeOrCountry}

Output

1️⃣ First modification : Renaming of the fields states_or_district.$values to field states_or_district.x-choices, and $meta to x-meta to match the json schema validator standard

"state_or_district": {
  "type": "string",
  "description": "administrative division",
  "examples": [
    "CA"
  ],
  "maxLength": 10,
-  "$values": [  
+  "x-choices": [
    {
      "code": "AA",
      "label": "ARMED FORCES AMERICAS"
    },
    {
      "code": "AE",
      "label": "ARMED FORCES AMERICAS"
    }
  ],
  "enum": [
    "AA",
    "AE"
  ]
}
{
!  "$meta": {
+  "x-meta": {
    "reference": "A",
    "id": 46282225,
    "type": "MAIN"
  }
}

2️⃣ Standardize the schema travel_documents issue_date property to issuing_date to match the PUT /v3/proposals/{proposal_id}/attendees issuing_date field naming + new pattern for authority field :

  • issue_date becomes issuing_date (which is the actual field in our PUT v3/attendees)
  • added pattern for authority property
"travel_documents": {
  "type": "object",
  "additionalProperties": false,
  "required": [
    "passport"
  ],
  "properties": {
    "passport": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "document_number",
        "expiration_date",
        "issue_date",
        "nationality",
        "authority",
        "issuing_country"
      ],
      "properties": {
        "document_number": {
          "type": "string",
          "description": "Document number",
          "examples": [
            "242343"
          ],
          "pattern": "^.{1,30}$"
        },
        "expiration_date": {
          "type": "string",
          "description": "Expiration date",
          "examples": [
            "20230624"
          ]
        },
        "issue_date": {
!       "issuing_date": {
          "type": "string",
          "description": "Issue date",
          "examples": [
            "20230624"
          ]
        },
        "nationality": {
          "type": "string",
          "description": "Nationality",
          "examples": [
            "French"
          ]
        },
        "authority": {
          "type": "string",
          "description": "Authority",
          "examples": [
            "France"
          ],
+         "pattern": "^.{1,35}$",
        },
        "issuing_country": {
          "type": "string",
          "description": "Issuing country",
          "examples": [
            "FR"
          ]
        }
      }
    }
  }
}

3️⃣ Third modification : Specify the expected identity type + add pattern to identity number + change of identity description

"identity": {
  "type": "object",
! "description": "Identity number" --> "National identifier code"
  "properties": {
    "number": {
      "type": "string"
+     "pattern" : "^.{1,30}$"
    },
    "type": {
      "type": "string",
      "enum": [
        "CPF",
-       "CUIL",
-       "TAX_NUMBER",
-       "SECURITY_NUMBER",
-       "ID_NUMBER",
-       "NATIONAL_REGISTER",
-       "DNI"
      ]
    }
  },
  "required": [
    "number",
    "type"
  ],
  "examples": [
    {
      "number": "1234",
      "type": "CPF"
    }
  ]
}