{"openapi":"3.0.3","info":{"title":"API Mascotas","version":"1.0","description":"API simple para listar y registrar mascotas de un refugio"},"servers":[{"url":"https://virtserver.swaggerhub.com/cybergreennexus/Mascotas/1.0"}],"paths":{"/mascotas":{"get":{"summary":"Listar mascotas","description":"Devuelve todas las mascotas disponibles y permite filtrar por especie, edad o tamaño.","tags":["Mascotas"],"parameters":[{"name":"especie","in":"query","required":false,"schema":{"type":"string"},"example":"perro"},{"name":"edad","in":"query","required":false,"schema":{"type":"integer"},"example":2},{"name":"tamano","in":"query","required":false,"schema":{"type":"string"},"example":"mediano"}],"responses":{"200":{"description":"Lista de mascotas","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Mascota"}},"example":[{"id":1,"nombre":"Luna","especie":"perro","edad":3,"foto_url":"https://example.com/foto1.jpg","disponible":true},{"id":2,"nombre":"Mishi","especie":"gato","edad":1,"foto_url":"https://example.com/foto2.jpg","disponible":true}]}}},"400":{"description":"Datos invalidos"},"500":{"description":"Error del servidor"}}},"post":{"summary":"Registrar mascota","description":"Permite agregar una nueva mascota al refugio.","tags":["Mascotas"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MascotaNueva"},"example":{"nombre":"Luna","especie":"perro","edad":3,"foto_url":"https://example.com/foto1.jpg","disponible":true}}}},"responses":{"201":{"description":"Mascota registrada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mascota"},"example":{"id":1,"nombre":"Luna","especie":"perro","edad":3,"foto_url":"https://example.com/foto1.jpg","disponible":true}}}},"400":{"description":"Datos invalidos"},"500":{"description":"Error del servidor"}}}},"/mascotas/{id}":{"get":{"summary":"Ver mascota por id","description":"Devuelve una mascota especifica.","tags":["Mascotas"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"example":1}],"responses":{"200":{"description":"Mascota encontrada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mascota"},"example":{"id":1,"nombre":"Luna","especie":"perro","edad":3,"foto_url":"https://example.com/foto1.jpg","disponible":true}}}},"404":{"description":"Mascota no encontrada"},"500":{"description":"Error del servidor"}}}}},"components":{"schemas":{"Mascota":{"type":"object","properties":{"id":{"type":"integer"},"nombre":{"type":"string"},"especie":{"type":"string"},"edad":{"type":"integer"},"foto_url":{"type":"string"},"disponible":{"type":"boolean"}},"required":["id","nombre","especie","edad","foto_url","disponible"]},"MascotaNueva":{"type":"object","properties":{"nombre":{"type":"string"},"especie":{"type":"string"},"edad":{"type":"integer"},"foto_url":{"type":"string"},"disponible":{"type":"boolean"}},"required":["nombre","especie","edad","foto_url","disponible"]}}},"tags":[{"name":"Mascotas"}]}