知识卡片
契约参与运行时路由
应用可以直接从定义查出路径和方法,再按生成器约定定位控制器及函数。这样减少另写一份路由表。扩展字段的意义取决于框架,文档和代码必须同步使用同一个映射。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Building a backend with Node.js and Swagger Codegen 13.3 The backend structure · 查看原书依据
To summarize, the combination of these two keywords, x-swagger-router-controller and operationId, connects the definition in OpenAPI with the implementation that is behind the respective operation.
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第13章《Building a backend with Node.js and Swagger Codegen》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch13.htm,阅读块 60)
- 结论依据:生成样例以 x-swagger-router-controller 与 operationId 联合选方法。
- 原始内容:To summarize, the combination of these two keywords, x-swagger-router-controller and operationId, connects the definition in OpenAPI with the implementation that is behind the respective operation.