{
 "openapi": "3.1.0",
 "info": {
  "title": "Centraljob.fr : offres d'emploi",
  "version": "1.0",
  "description": "Offres d'emploi en France, tous métiers, de recruteurs vérifiés. Lecture seule, sans clé ni compte : fichiers JSON statiques, mis à jour plusieurs fois par jour. Postuler ou publier se fait par email (information@centraljob.fr) ou sur le site du recruteur ; voir https://www.centraljob.fr/agents.html."
 },
 "servers": [
  {
   "url": "https://www.centraljob.fr"
  }
 ],
 "paths": {
  "/api/offres.json": {
   "get": {
    "operationId": "listerOffres",
    "summary": "Toutes les offres en cours (résumé), de la plus récente à la plus ancienne",
    "description": "Le filtrage (domaine, contrat, région, mot-clé) se fait côté client sur cette liste.",
    "responses": {
     "200": {
      "description": "Liste des offres",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "site": {
           "type": "string"
          },
          "documentation": {
           "type": "string"
          },
          "openapi": {
           "type": "string"
          },
          "nombre": {
           "type": "integer"
          },
          "ordre": {
           "type": "string"
          },
          "offres": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Offre"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/offres/{id}.json": {
   "get": {
    "operationId": "lireOffre",
    "summary": "Une offre, avec son texte complet",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "L'offre",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OffreDetail"
        }
       }
      }
     },
     "410": {
      "description": "Offre terminée (pourvue, retirée ou expirée)"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Offre": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "titre": {
      "type": "string"
     },
     "structure": {
      "type": "string"
     },
     "ville": {
      "type": "string"
     },
     "departement": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "domaine": {
      "type": "string",
      "enum": [
       "sante",
       "hotellerie",
       "enseignement",
       "btp",
       "transport",
       "industrie",
       "informatique",
       "marketing",
       "commerce",
       "agriculture",
       "administratif",
       "autres"
      ]
     },
     "domaine_libelle": {
      "type": "string"
     },
     "contrat": {
      "type": "string",
      "enum": [
       "CDI",
       "CDD",
       "Intérim",
       "Alternance",
       "Stage",
       "Saisonnier",
       "Indépendant",
       "Non précisé"
      ]
     },
     "temps": {
      "type": "string"
     },
     "remuneration": {
      "type": "string"
     },
     "publie_le": {
      "type": "string",
      "format": "date"
     },
     "fin": {
      "type": "string",
      "format": "date"
     },
     "fiche": {
      "type": "string",
      "format": "uri"
     },
     "detail": {
      "type": "string",
      "format": "uri"
     },
     "postuler": {
      "type": "object",
      "description": "Comment postuler : sur le site du recruteur (url) ou par email à Centraljob (adresse, objet exact, contenu attendu).",
      "properties": {
       "mode": {
        "type": "string",
        "enum": [
         "site_recruteur",
         "email"
        ]
       },
       "url": {
        "type": "string"
       },
       "adresse": {
        "type": "string"
       },
       "objet": {
        "type": "string"
       },
       "contenu": {
        "type": "string"
       }
      }
     }
    }
   },
   "OffreDetail": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Offre"
     },
     {
      "type": "object",
      "properties": {
       "origine": {
        "type": "string"
       },
       "description": {
        "type": "string"
       },
       "missions": {
        "type": "string"
       },
       "profil": {
        "type": "string"
       },
       "debut": {
        "type": "string"
       },
       "limite": {
        "type": "string"
       }
      }
     }
    ]
   }
  }
 }
}
