Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 解决/v2/api-docs获取不到内容导致获取不到API页面内容的问题 #317

Closed
logan2013 opened this issue May 23, 2022 · 7 comments · Fixed by #319
Closed
Labels
bug Something isn't working

Comments

@logan2013
Copy link

logan2013 commented May 23, 2022

Swagger的Json处理,解决/v2/api-docs获取不到内容导致获取不到API页面内容的问题

@logan2013 logan2013 added the bug Something isn't working label May 23, 2022
@VictorZeng
Copy link
Collaborator

@logan2013 收到,请稍后~

VictorZeng added a commit to VictorZeng/fastjson2 that referenced this issue May 23, 2022
@logan2013
Copy link
Author

logan2013 commented May 23, 2022

@VictorZeng 我也临时写了一个writer,最终调用writeString,但是序列化后是一个字符串,感觉不是很合理哈

@VictorZeng
Copy link
Collaborator

@logan2013 除了序列化成字符串暂时没想到其他好办法~~~

@VictorZeng
Copy link
Collaborator

可以再快照版本提前使用SwaggerJsonWriter

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension</artifactId>
    <version>2.0.5-SNAPSHOT</version>
</dependency>
JSON.register(springfox.documentation.spring.web.json.Json.class, SwaggerJsonWriter.INSTANCE);

@CodeKjm
Copy link

CodeKjm commented Sep 9, 2022

你好,没看懂这行代码在哪里实现?需要自定义一个类吗?
JSON.register(springfox.documentation.spring.web.json.Json.class, SwaggerJsonWriter.INSTANCE);

@CodeKjm
Copy link

CodeKjm commented Sep 9, 2022

我看最新版本的SwaggerJsonWriter和OpenApiJsonWriter都不存在,是没合并分支吗?

@VictorZeng
Copy link
Collaborator

@CodeKjm 已经内置实现,不需要单独注册了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants