Comments (5)
解决方案有二:
- 在
parseSwaggerMods
的时候将basePath
和path
进行拼接 - 在生成代码的时候将
basePath
和path
进行拼接
@jimliang @jasonHzq @gaoletian 大家觉得哪种方案更好?我个人倾向于方案二,理由是不改变元数据,而只改变消费数据的方式
from pont.
经确认,最终生成的api-lock
文件里面其实是有basePath
属性,只是数据结构里面没有类型描述,所以考虑先加一下basePath
的类型描述,在生成代码的时候再做拼接了。
from pont.
请问需要basePath做什么呢? 如果是接口 url 的拼接,完全可以写在业务方的公共请求方法内部。
from pont.
有需要的!!!现在requeset里只有paths的部分没有添加上basePath;我有十几个这种swagger,basePath不一样,ip端口一样,公共请求没法封装啊;
from pont.
有需要的!!!现在requeset里只有paths的部分没有添加上basePath;我有十几个这种swagger,basePath不一样,ip端口一样,公共请求没法封装啊;
我现在的做法是用projectAssess做datasource Name,重写getInterfaceContent方法取name转/project/assess + path;
勉强可以使用。。。。
from pont.
Related Issues (20)
- pont无法使用 HOT 3
- OpenAPI 下,POST 请求,同时存在路径参数与请求体参数时,路径参数丢失 HOT 1
- tag name被翻译,导致整个模块名发生变化,导致使用时报错 HOT 1
- can not install HOT 1
- 同时启用`"usingMultipleOrigins": true`和`"spiltApiLock": true` - 新增数据源时会报文件不存在的异常 HOT 2
- pont执行失败 HOT 1
- 水平堪忧啊,一更新类型全没了 HOT 3
- vscode-pont新版transform不生效 HOT 1
- pont start后报错Error: ENOENT: no such file or directory, open 'D:\soft\nvm\v12.14.0\node_modules\pont-engine\lib\package.json' HOT 1
- SwaggerV3 规范的数据源解析错误
- translate error, all translate engine can not access HOT 4
- 获远程接口数据失败 Error: compiler error in defname HOT 3
- 多个origins时重写CodeGenerator的getInterfaceContentInDeclaration方法不生效
- 能否在 Interface 中添加 operationId 属性
- 获远程接口数据失败 Error: compiler error in defname: DataList«task_alert_contact的实体类» HOT 2
- 修改 templatePath 对应模板中自定义接口内容,执行生成代码操作,outDir 接口文件内容不更新 HOT 1
- Extension causes high cpu load
- 所有的翻译插件失效,pont解析swagger报错 HOT 1
- 不生成 pontCore.js HOT 2
- 请问有没有nodejs api使用文档? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pont.