-
Notifications
You must be signed in to change notification settings - Fork 280
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
The generated openapi.json
file does not correctly assign the format
property to path parameters of the interfaces.
#578
Comments
i can't reproduce the bug "schemas": {
"string": {
"format": "string",
"type": "string"
}
} code: @RestController("test")
public class TestController {
/**
* 这个是一个更新接口
*
* @param id id
* @return string
*/
@PostMapping("/{id}/update")
public String update(@PathVariable String id) {
return null;
}
} pom.xml : <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.7.1</version>
</dependency>
</dependencies> <plugins>
<plugin>
<groupId>com.github.shalousun</groupId>
<artifactId>smart-doc-maven-plugin</artifactId>
<version>2.7.5</version>
<configuration>
<configFile>./src/main/resources/smart-doc.json</configFile>
</configuration>
</plugin>
</plugins> smart-doc.json: {
"outPath": "target/doc"
} |
I'll try again |
can you debug the plugin?I want to add a breat on the following function
|
|
The breakpoint has been hit at the function I mentioned previously. For the |
generated by me "components": {
"schemas": {
"string": {
"format": "string",
"type": "string"
}
}
} It seems like my reference was to |
my mistake in the issue, I meant the @PostMapping annotation |
can you provide the configuration for smart-doc please? |
|
Indeed, there is a "string" defined in the "components". However, the "parameters" I mentioned are situated within the properties indexed by the interface's name. Namely,
|
I'm not overly familiar with generating OpenAPI specifications myself, and my OpenAPI output doesn't even include the details you've mentioned. |
Alright, I'll set up a project to test it. Please give me a moment. Thank you for your patience. |
I might not be able to upload the code to GitHub easily due to company policies. Instead, I forked your smart-doc-demo repository. Then, I adjusted the Spring Boot version to 2.7.1, set the Java version to 1.8, and updated the smart-doc version to 2.7.5, keeping all other configurations unchanged. Afterwards, I made adjustments to the code.
|
There is a field like this, inside which lies the
|
https://github.com/FeiyuEVE/smart-doc-demo/tree/codespace-effective-giggle-r9wrxx5w4525469 |
reproduce it,however ,I'm not quit familiar with OpenAPI yet; I'll go and learn more about it first |
openapi.json
file does not correctly assign the format
property to path parameters of the interfaces.
Your Environment(您的使用环境)
Expected Behavior(您期望的结果)
Under springboot 2.7.1
Using smart-doc to generate openapi.json, the description of this interface in
Causes the function parameter id to be of String type in the springboot client request generated through this openapi.json and openapi-generator
Current Behavior(当前结果)
Under springboot 2.7.1
Using smart-doc to generate openapi.json, the description of this interface in
The issue results in the parameter
id
being generated as anInteger
type in the Spring Boot client requests when utilizingopenapi.json
alongside theopenapi-generator
.The text was updated successfully, but these errors were encountered: