{
  "openapi": "3.1.0",
  "info": {
    "title": "Software para Hoteles: datos abiertos",
    "version": "1.0.0",
    "summary": "Datos de solo lectura del directorio de software hotelero.",
    "description": "Datos verificados de software para hoteles, con licencia CC BY 4.0. No requiere autenticación.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "contact": {
      "email": "info@softwareparahoteles.app",
      "url": "https://softwareparahoteles.app/desarrolladores/"
    }
  },
  "servers": [
    {
      "url": "https://softwareparahoteles.app"
    }
  ],
  "paths": {
    "/data/software.json": {
      "get": {
        "operationId": "listarSoftware",
        "summary": "Todas las fichas de software con sus datos completos",
        "responses": {
          "200": {
            "description": "Conjunto de datos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "actualizado": {
                      "type": "string",
                      "format": "date"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "software": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ficha"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/software/{slug}.md": {
      "get": {
        "operationId": "fichaMarkdown",
        "summary": "Ficha de un software en Markdown",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "amenitiz",
                "anfy",
                "apaleo",
                "avantio",
                "avirato",
                "axis-pms",
                "beds24",
                "beyond",
                "bookingflow",
                "clock-pms",
                "cloudbeds",
                "cqr",
                "dingus",
                "eviivo",
                "guesty",
                "hospitable",
                "hostaway",
                "hoteldrive",
                "hotelero-cl",
                "hotelgest",
                "hotelogix",
                "icnea",
                "kross-booking",
                "little-hotelier",
                "lobbypms",
                "lodgify",
                "lodgy",
                "loggro-alojamientos",
                "mews",
                "minihotel",
                "mirai",
                "neobookings",
                "noray-htl",
                "novohit",
                "okfac",
                "opera-cloud",
                "ownerrez",
                "paraty-tech",
                "pricelabs",
                "pxsol",
                "rentals-united",
                "roiback",
                "roompricegenie",
                "roomraccoon",
                "samin-pms",
                "sentaury",
                "sihoteles",
                "sirvoy",
                "siteminder",
                "smoobu",
                "syshotel",
                "tca-innsist",
                "winhotel",
                "xafiro",
                "zavia",
                "zeus-cloud-pms"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ficha",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No existe"
          }
        }
      }
    },
    "/buscar.json": {
      "get": {
        "operationId": "indiceBusqueda",
        "summary": "Índice de búsqueda del sitio: fichas, países, comparativas, glosario y blog",
        "responses": {
          "200": {
            "description": "Lista de elementos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "k": {
                        "type": "string",
                        "description": "Tipo de contenido"
                      },
                      "t": {
                        "type": "string",
                        "description": "Título"
                      },
                      "u": {
                        "type": "string",
                        "description": "Ruta"
                      },
                      "d": {
                        "type": "string",
                        "description": "Descripción"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/geo": {
      "get": {
        "operationId": "paisDelVisitante",
        "summary": "País desde el que se hace la petición",
        "responses": {
          "200": {
            "description": "Código ISO del país o null",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pais": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/sugerir": {
      "post": {
        "operationId": "sugerirSoftware",
        "summary": "Proponer un software para que se añada al directorio",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "software",
                  "web",
                  "acepto"
                ],
                "properties": {
                  "software": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "web": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "tipo": {
                    "type": "string"
                  },
                  "paises": {
                    "type": "string"
                  },
                  "motivo": {
                    "type": "string",
                    "maxLength": 1500
                  },
                  "nombre": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "relacion": {
                    "type": "string",
                    "enum": [
                      "usuario",
                      "proveedor",
                      "otro",
                      ""
                    ]
                  },
                  "acepto": {
                    "type": "boolean",
                    "description": "Aceptación del aviso de privacidad"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recibida"
          },
          "422": {
            "description": "Datos no válidos"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Ficha": {
        "type": "object",
        "description": "Ficha de un software. Esquema completo en la metodología del sitio.",
        "properties": {
          "slug": {
            "type": "string"
          },
          "nombre": {
            "type": "string"
          },
          "url_oficial": {
            "type": "string",
            "format": "uri"
          },
          "resumen": {
            "type": "string"
          },
          "categorias": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "funciones": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "si",
                "no",
                "addon",
                null
              ]
            }
          },
          "precios": {
            "type": "object"
          },
          "regiones": {
            "type": "object"
          },
          "verificado": {
            "type": "string",
            "format": "date"
          },
          "ficha": {
            "type": "string",
            "format": "uri"
          },
          "markdown": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
