tangcent / easy-api Goto Github PK
View Code? Open in Web Editor NEWGenerate API document
Home Page: https://easyapi.itangcent.com
License: GNU Affero General Public License v3.0
Generate API document
Home Page: https://easyapi.itangcent.com
License: GNU Affero General Public License v3.0
support {@link ...} in param desc doc like:
/**
* some api
*
* @param path path_desc {@link com.itangcent.Paths}
*/
@ResponseBody
@RequestMapping(value = "/some/{path}", method = RequestMethod.POST)
public Result method(@PathVariable("path") String path) {
...
}
class Paths:
class Paths{
private final static PATH1 = "path1";//first path
private final static PATH2 = "path2";//second path
}
expect output doc:
name | desc |
---|---|
path | path_desc path1:first path path2:second path |
So that developers can use groovy scripts in their local project to implement the highly customized actions to satisfy the special needs of their business, and it is free and safe to upgrade the plugin and get the features of the plugin upgrades.
see tangcent/easy-yapi#27
ide plugin EasyApi 0.9.183.0.5 ,增强了接口返回类型推断;比如系统类型 Date ,会被当做 object 推断其属性,请问如何避免推断层次过深?
谢谢!
type | example |
---|---|
Object | Object |
GenericClass | Map |
GenericClass<Object> | List<Object> |
project api | postman▽ |
---|---|
moduleA | CollectionA |
|─classA | CollectionB |
|─apiA | CollectionC |
|─apiB | ... |
|─classB | ... |
project api | postman▽ |
---|---|
moduleA | CollectionA |
|─attr of classA | CollectionB |
|─attr of apiA | CollectionC |
|─attr of apiB | ... |
|─attr of classB | ... |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
see #12
support javax.validation and org.hibernate.validator by default
support js expression
support context:it
support method in it:
if it is class
if it is method
if it is arg
Receiving this error when attempting to export an api in a directory (code -> export Postman)
IntelliJ 2019.2 Ultimate, JDK 11.
[ERROR] error to parse body
[TRACE] java.util.ConcurrentModificationException
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
at com.itangcent.intellij.psi.DuckTypeHelper.resolve(DuckTypeHelper.kt:91)
at com.itangcent.intellij.psi.DuckTypeHelper.resolve(DuckTypeHelper.kt:78)
at com.itangcent.intellij.psi.AbstractPsiClassHelper.getTypeObject(AbstractPsiClassHelper.kt:175)
at com.itangcent.idea.plugin.api.export.SpringClassExporter.parseResponseBody(SpringClassExporter.kt:604)
at com.itangcent.idea.plugin.api.export.SpringClassExporter.processResponse(SpringClassExporter.kt:173)
at com.itangcent.idea.plugin.api.export.SpringClassExporter.exportMethodApi(SpringClassExporter.kt:155)
at com.itangcent.idea.plugin.api.export.SpringClassExporter.access$exportMethodApi(SpringClassExporter.kt:33)
at com.itangcent.idea.plugin.api.export.SpringClassExporter$export$1.invoke(SpringClassExporter.kt:92)
at com.itangcent.idea.plugin.api.export.SpringClassExporter$export$1.invoke(SpringClassExporter.kt:33)
at com.itangcent.idea.plugin.api.export.SpringClassExporter.foreachMethod(SpringClassExporter.kt:671)
at com.itangcent.idea.plugin.api.export.SpringClassExporter.export(SpringClassExporter.kt:91)
at com.itangcent.idea.plugin.api.cache.CachedClassExporter$export$1$2.invoke(CachedClassExporter.kt:114)
at com.itangcent.idea.plugin.api.cache.CachedClassExporter$export$1$2.invoke(CachedClassExporter.kt:23)
at com.itangcent.intellij.context.ActionContext$runInReadUI$1.run(ActionContext.kt:293)
at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:936)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
at com.itangcent.intellij.context.ActionContext.runInReadUI(ActionContext.kt:290)
at com.itangcent.idea.plugin.api.cache.CachedClassExporter$export$1.invoke(CachedClassExporter.kt:112)
at com.itangcent.idea.plugin.api.cache.CachedClassExporter$export$1.invoke(CachedClassExporter.kt:23)
at com.itangcent.intellij.context.ActionContext$runAsync$2.run(ActionContext.kt:169)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Describe the bug
The module rule in config not work
see kotlin-doc
When exporting APIs in a sub class but there's some api was defined in super class.
For these apis the base path should be the path in RequestMapping on sub class not the path from super class
read cache at nonui thread
see (#17)
For example the request body can be one of the following way and it will be decoded automatically in both the annotation and the functional programming models:
Account account — the account is deserialized without blocking before the controller is invoked.
Mono<Account> account — the controller can use the Mono to declare logic to be executed - after the account is deserialized.
Single<Account> account — same as with Mono but using RxJava
Flux<Account> accounts — input streaming scenario.
Observable<Account> accounts — input streaming with RxJava.
The response body can be one of the following:
Mono<Account> — serialize without blocking the given Account when the Mono completes.
Single<Account> — same but using RxJava.
Flux<Account> — streaming scenario, possibly SSE depending on the requested content type.
Observable<Account> — same but using RxJava Observable type.
Flowable<Account> — same but using RxJava 2 Flowable type.
Flux<ServerSentEvent> — SSE streaming.
Mono<Void> — request handling completes when the Mono completes.
Account — serialize without blocking the given Account; implies a synchronous, non-blocking controller method.
void — specific to the annotation-based programming model, request handling completes when the method returns; implies a synchronous, non-blocking controller method.
When using stream types like Flux or Observable, the media type specified in the request/response or at mapping/routing level is used to determine how the data should be serialized and flushed. For example a REST endpoint that returns a Flux will be serialized by default as following:
Spring Rest Request Annotations like @PostMapping,@GetMapping,@PutMapping,@DeleteMapping
are not be supported
Describe the bug
com.intellij.diagnostic.PluginException: action with the ID "com.itangcent.idea.easy_api.actions.PostmanExportAction" was already registered. Action being registered is ExportPostman (Export Postman); Registered action is Export Postman (Export Postman) Plugin: EasyApi [Plugin: com.itangcent.idea.plugin.easy-api]
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No issue should be displayed.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
desc | rule | example | status |
---|---|---|---|
A blank line matches no files, so it can serve as a separator for readability. | |||
A line starting with # serves as a comment. | #comment |
#exclude all api in directory foo/bar | |
ignore all api in dir | dir/ |
foo/ | |
ignore api by file and api method name | ignore_file#method_name |
foo/Foo#method | |
ignore api by file and api method name and args | ignore_file#method_name(args...) |
foo/Foo#method(arg1) | |
ignore api by httpMethod and url | :METHOD:path |
:GET:/foo/a/b | |
::/foo/a/b |
Dashboard:
project api | postman▽ |
---|---|
root | CollectionA |
|─moduleA | CollectionB |
|─apiA | CollectionC |
|─apiB | moduleA |
|─moduleB | |─apiA |
Dashboard:
project api | postman▽ |
---|---|
root | CollectionA |
|─moduleA | CollectionB |
|─apiA | CollectionC |
|─apiB | ... |
|─moduleB | ... |
Action:
Describe the bug
Expected behavior
public enum Distance {
KILOMETER("km", 1000),
MILE("miles", 1609.34),
METER("meters", 1),
INCH("inches", 0.0254),
CENTIMETER("cm", 0.01),
MILLIMETER("mm", 0.001);
private String unit;
private final double meters;
private Distance(String unit, double meters) {
this.unit = unit;
this.meters = meters;
}
public String getUnit() {
return unit;
}
public double getMeters() {
return meters;
}
}
private Distance distance;
Will be equivalent to
/**
* @see Distance
*/
private String distance;
json.rule.enum.convert[your enum class]=your enum class#value field
abbreviated:
json.rule.enum.convert[your enum class]=#value field
getter
) - for example:json.rule.enum.convert[your enum class]=your enum class#method
abbreviated:
json.rule.enum.convert[your enum class]=~#method
json.rule.enum.convert[groovy:it.extend("com.itangcent.Describable")]=~#desc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.