У меня есть две простые сущности, подобные этой:
public class Agent extends BasedEntity {
private String firstname;
private String lastname;
@ManyToOne
@JoinColumn(name="agency_id", nullable=true)
Agency agency;
}
и
public class Agency extends BasedEntity {
private String name;
private String address;
@OneToMany(mappedBy="agency")
private Set<Agent> agents;
}
@RepositoryRestResource
public interface AgencyRespository extends JpaRepository<Agency, Long> {
}
@RepositoryRestResource
public interface AgentsRespository extends JpaRepository<Agent, Long> {
}
Когда я делаю PUT с
https://localhost:8080/api/v1/agents/64/agency
body:https://localhost:8080/api/v1/agencies/50
, он проходит, но еслиЯ делаю POST
https://localhost:8080/api/v1/agents/64/agency
body:https://localhost:8080/api/v1/agencies/50
Я получаю
org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported