English 中文(简体)
缩略语
原标题:SwaggerUI/OpenAPI contains full CRUD REST endpoints without defining them

I've创建了一个春季间项目,并定义了一名教育、科学和技术部控制员,其任期为/employers

@RestController
public class EmployerController {

    @Autowired
    private EmployerService employerService;

    @GetMapping(path = "/employers")
    public List<Employer> getEmployers() {
        return (List<Employer>) employerService.getEmployers();
    }
}

Additionally, I’ve created the associated EmployerService, EmployerRepository, and Employer entity

当我把Swagger/OpenAPI添加到门类,然后浏览到<条码>http:// localhost:80/swagger-ui.html时,雇主实体的CRUD REST定义全文如下:

“Full

为什么在我只界定了<代码>GET/employers的单一端点时,雇主就完全界定了CRUD REST的AP? 如果这是可以想象的,是否有可能使教育、科学和技术部长的自动制作失效?

问题回答

我的猜测是,如果你创设了<条码>@ Entity附加说明的班级和一个十字架,你将重新使用<条码>代谢-数据-rest。

因此,你们的建设取决于你们。 gradle or pom.xml? 我想,除通常的<条码>、代子-开端和<条码>外,再使用其他东西。

无论如何,我认为,所有这些终点都来自你提供的座标上的一个<编码>@GetMapping。 我们一定会看到你们的附属点和其余部分。 具体来说,<代码>是什么。 扩大实施的雇主信息库 如果它有<条码>,则使用<条码>,并改用<条码>。 我认为,这将解释。

https://docs.enfant.io/mer- data/rest/vis/reito- resourcess.html” rel=“no followlow noreferer” https://docs.mers.io/mers/mission- data/rest/vis/repos- Resourcess.html





相关问题
WAF FILE could not EXPORT due to no WEB PROJECT option found

I was trying to create a war file on spring tool suite 4 (windows version). But as I was about to export the it to the local file system, I couldn t find the web project (wiseai-console) option of the ...

Combine multiple cb.literal() into 1 Expression

I am working on a Spring Boot project that uses PostgreSQL. I want to create a advanced search feature where user can search through the jsonb column that I have in many of my tables. Somewhere in my ...

Error using criteriaBuilder.max() for LocalDate

I am trying to get max date using criteria builder in a subquery. But I am getting this error Required type: Expression Provided: Expression Subquery<LocalDate> subRoot = criteriaQuery....

热门标签