{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carhunt-fr/json-schema/carhunt-fr-resolve-response-schema.json",
  "title": "ResolveResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/carhunt-fr-recherche-api-openapi.yml#/components/schemas/ResolveResponse",
  "properties": {
    "listing": {
      "allOf": [
        {
          "$ref": "#/$defs/ListingOut"
        }
      ],
      "description": "Véhicule canonique dédoublonné ; sa source et son prix peuvent différer de la source recherchée"
    },
    "matched_source": {
      "$ref": "#/$defs/MatchedSourceOut"
    }
  },
  "type": "object",
  "required": [
    "listing",
    "matched_source"
  ],
  "$defs": {
    "ListingOut": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "make": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Make"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version",
          "description": "Libellé de version brut de l'annonce"
        },
        "finition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Finition",
          "description": "Finition normalisée (ex. « R-Line ») — disponible sur ~2/3 des annonces"
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Year"
        },
        "mileage": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mileage"
        },
        "price": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price"
        },
        "energy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Energy"
        },
        "gearbox": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gearbox"
        },
        "horsepower": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Horsepower"
        },
        "seller_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Seller Type",
          "description": "'pro' | 'private' | null (inconnu) — capturé depuis le 2026-07-17, couverture croissante au fil des re-scrapes"
        },
        "department": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Department"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "deal_score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deal Score",
          "description": "Score de sous-cote 0-100 (50 = prix médian marché, plus haut = meilleure affaire)"
        },
        "photo_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Photo Url"
        },
        "source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source",
          "description": "Site annonceur d'origine"
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url",
          "description": "Lien direct vers l'annonce d'origine"
        },
        "first_seen": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Seen",
          "description": "Découverte de l'annonce par CarHunt (base du paramètre `since`)"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "ListingOut",
      "description": "Une annonce. `source_url` pointe vers l'annonce chez l'annonceur d'origine."
    },
    "MatchedSourceOut": {
      "properties": {
        "source": {
          "type": "string",
          "title": "Source"
        },
        "external_id": {
          "type": "string",
          "title": "External Id",
          "description": "Identifiant tel que stocké pour la source retrouvée"
        },
        "source_url": {
          "type": "string",
          "title": "Source Url",
          "description": "Lien stocké de la source recherchée, sans garantie de disponibilité chez l'éditeur"
        },
        "price": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price"
        },
        "photo_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Photo Url"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At",
          "description": "Dernière actualisation connue de cette source"
        }
      },
      "type": "object",
      "required": [
        "source",
        "external_id",
        "source_url"
      ],
      "title": "MatchedSourceOut"
    }
  }
}