{"openapi":"3.0.3","info":{"title":"API bd_gestao_futebol","version":"1.0.4","description":"API para o sistema de Gestão de Campeonatos de Futebol.\n\n### Controle de Acesso Baseado em Perfis (RBAC):\n- role_diretor (Admin): acesso total.\n- role_coordenador: leitura e escrita parcial.\n- role_analista: somente leitura."},"servers":[{"url":"https://jsonplaceholder.typicode.com","description":"Fake API (JSONPlaceholder)"}],"tags":[{"name":"Partidas"},{"name":"Times"},{"name":"Jogadores"},{"name":"Estadios"},{"name":"Campeonatos"},{"name":"Enderecos"}],"paths":{"/partidas":{"get":{"tags":["Partidas"],"summary":"Lista partidas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Partida"}}}}}}},"post":{"tags":["Partidas"],"summary":"Cria partida","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartidaInput"}}}},"responses":{"201":{"description":"Criado"}}}},"/partidas/{idPartida}":{"get":{"tags":["Partidas"],"summary":"Busca partida por ID","parameters":[{"name":"idPartida","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Partida"}}}}}},"put":{"tags":["Partidas"],"summary":"Atualiza partida","parameters":[{"name":"idPartida","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartidaInput"}}}},"responses":{"200":{"description":"Atualizado"}}},"delete":{"tags":["Partidas"],"summary":"Remove partida","parameters":[{"name":"idPartida","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Removido"}}}},"/times":{"get":{"tags":["Times"],"summary":"Lista times","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Time"}}}}}}},"post":{"tags":["Times"],"summary":"Cria time","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeInput"}}}},"responses":{"201":{"description":"Criado"}}}},"/times/{idTime}":{"get":{"tags":["Times"],"summary":"Busca time por ID","parameters":[{"name":"idTime","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Time"}}}}}},"put":{"tags":["Times"],"summary":"Atualiza time","parameters":[{"name":"idTime","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeInput"}}}},"responses":{"200":{"description":"Atualizado"}}},"delete":{"tags":["Times"],"summary":"Remove time","parameters":[{"name":"idTime","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Removido"}}}},"/jogadores":{"get":{"tags":["Jogadores"],"summary":"Lista jogadores","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Jogador"}}}}}}},"post":{"tags":["Jogadores"],"summary":"Cria jogador","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JogadorInput"}}}},"responses":{"201":{"description":"Criado"}}}},"/jogadores/{idJogador}":{"get":{"tags":["Jogadores"],"summary":"Busca jogador por ID","parameters":[{"name":"idJogador","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Jogador"}}}}}},"put":{"tags":["Jogadores"],"summary":"Atualiza jogador","parameters":[{"name":"idJogador","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JogadorInput"}}}},"responses":{"200":{"description":"Atualizado"}}},"delete":{"tags":["Jogadores"],"summary":"Remove jogador","parameters":[{"name":"idJogador","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Removido"}}}},"/estadios":{"get":{"tags":["Estadios"],"summary":"Lista estadios","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Estadio"}}}}}}},"post":{"tags":["Estadios"],"summary":"Cria estadio","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstadioInput"}}}},"responses":{"201":{"description":"Criado"}}}},"/estadios/{idEstadio}":{"get":{"tags":["Estadios"],"summary":"Busca estadio por ID","parameters":[{"name":"idEstadio","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Estadio"}}}}}},"put":{"tags":["Estadios"],"summary":"Atualiza estadio","parameters":[{"name":"idEstadio","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstadioInput"}}}},"responses":{"200":{"description":"Atualizado"}}},"delete":{"tags":["Estadios"],"summary":"Remove estadio","parameters":[{"name":"idEstadio","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Removido"}}}},"/campeonatos":{"get":{"tags":["Campeonatos"],"summary":"Lista campeonatos","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Campeonato"}}}}}}},"post":{"tags":["Campeonatos"],"summary":"Cria campeonato","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampeonatoInput"}}}},"responses":{"201":{"description":"Criado"}}}},"/campeonatos/{idCampeonato}":{"get":{"tags":["Campeonatos"],"summary":"Busca campeonato por ID","parameters":[{"name":"idCampeonato","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campeonato"}}}}}},"put":{"tags":["Campeonatos"],"summary":"Atualiza campeonato","parameters":[{"name":"idCampeonato","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampeonatoInput"}}}},"responses":{"200":{"description":"Atualizado"}}},"delete":{"tags":["Campeonatos"],"summary":"Remove campeonato","parameters":[{"name":"idCampeonato","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Removido"}}}},"/enderecos":{"get":{"tags":["Enderecos"],"summary":"Lista enderecos","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Endereco"}}}}}}},"post":{"tags":["Enderecos"],"summary":"Cria endereco","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnderecoInput"}}}},"responses":{"201":{"description":"Criado"}}}},"/enderecos/{idEndereco}":{"get":{"tags":["Enderecos"],"summary":"Busca endereco por ID","parameters":[{"name":"idEndereco","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Endereco"}}}}}},"put":{"tags":["Enderecos"],"summary":"Atualiza endereco","parameters":[{"name":"idEndereco","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnderecoInput"}}}},"responses":{"200":{"description":"Atualizado"}}},"delete":{"tags":["Enderecos"],"summary":"Remove endereco","parameters":[{"name":"idEndereco","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Removido"}}}}},"components":{"schemas":{"Partida":{"type":"object","properties":{"id":{"type":"integer","example":1},"data":{"type":"string","example":"2026-01-01"},"hora":{"type":"string","example":"16:00"},"gols_mandante":{"type":"integer","example":1},"gols_visitante":{"type":"integer","example":0},"valor_ingresso":{"type":"number","format":"float","example":40}}},"PartidaInput":{"type":"object","properties":{"id":{"type":"integer"},"data":{"type":"string"},"hora":{"type":"string"},"gols_mandante":{"type":"integer"},"gols_visitante":{"type":"integer"}}},"Time":{"type":"object","properties":{"id":{"type":"integer","example":1},"nome":{"type":"string","example":"Time A"}}},"TimeInput":{"type":"object","properties":{"id":{"type":"integer"},"nome":{"type":"string"}}},"Jogador":{"type":"object","properties":{"id":{"type":"integer","example":1},"nome":{"type":"string","example":"Carlos Alberto"},"altura":{"type":"number","format":"float","example":1.82}}},"JogadorInput":{"type":"object","properties":{"id":{"type":"integer"},"nome":{"type":"string"},"altura":{"type":"number"}}},"Estadio":{"type":"object","properties":{"id":{"type":"integer","example":1},"nome":{"type":"string","example":"Estádio Central"}}},"EstadioInput":{"type":"object","properties":{"id":{"type":"integer"},"nome":{"type":"string"}}},"Campeonato":{"type":"object","properties":{"id":{"type":"integer","example":1},"nome":{"type":"string","example":"Campeonato Brasileiro"},"ano":{"type":"integer","example":2026}}},"CampeonatoInput":{"type":"object","properties":{"id":{"type":"integer"},"nome":{"type":"string"},"ano":{"type":"integer"}}},"Endereco":{"type":"object","properties":{"id":{"type":"integer","example":1},"logradouro":{"type":"string","example":"Av. Principal"},"numero":{"type":"integer","example":10},"bairro":{"type":"string","example":"Centro"}}},"EnderecoInput":{"type":"object","properties":{"id":{"type":"integer"},"logradouro":{"type":"string"},"numero":{"type":"integer"},"bairro":{"type":"string"}}}}}}