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

When 'requestExample' is set to false, the sample data cannot be removed. #233

Closed
inernoro opened this issue Apr 15, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@inernoro
Copy link

inernoro commented Apr 15, 2022

  • smart-doc version: 2.4.2
  • plugin version (e.g. smart-doc-maven-plugin or smart-doc-gradle-plugin): small:openapi
  • build tool version (maven or gradle): mvn 3.5.2 and Java 1.8.0_41
  • Spring version 2.6.3 on Windows 11 system
  • IntelliJ IDEA version 2021.3.3

Expected Behavior (What you expect to happen)

When the configuration option 'requestExample' is set to false, example data should not be generated.

Current Behavior (What is actually happening)

The generated sample reference data cannot be removed.

Steps to Reproduce (Bug reproduction steps, please provide test code if possible)

This issue occurs with any interface.

Context (Description of the bug's impact)

It causes OpenAPI to generate code using data from the examples to modify class names

Even when set to false, it still exists.
image
This results in
image

I have confirmed that I deleted the built openapi.json,

I have confirmed that I deleted the build target before clicking the plugin button,

I have confirmed that I stopped the project before starting to generate,

I have confirmed that I entered false instead of "false"

smart-doc.json (local, privacy not affected)

{
  "requestExample": false,
  "responseExample": false,
  "outPath": "api",
  "serverUrl": "http://192.168.5.36:7878",
  "isStrict": false,
  "projectName": "sirius",
  "appToken": "1d577ec5d60648afb65daadb8718eea9",
  "openUrl": "http://192.168.5.166:7700/api",
  "debugEnvName": "测试环境",
  "replace": true,
  "debugEnvUrl": "http://192.168.5.36:7878",
  "responseBodyAdvice": {
    "className": "com.miduonet.sirius.classlibrary.basiccomponents.ResultData"
  }
}

pom.xml configuration

<plugin>
    <groupId>com.github.shalousun</groupId>
    <artifactId>smart-doc-maven-plugin</artifactId>
    <version>2.4.2</version>
    <configuration>
        <!--Specify the configuration file used for generating the documentation, placed in your own project-->
        <configFile>./src/main/resources/smart-doc.json</configFile>
        <!--Specify the project name-->
        <projectName>测试</projectName>
        <includes>
            <include>com.alibaba:fastjson</include>
        </includes>
    </configuration>
    <executions>
        <execution>
            <!--If you do not need to start smart-doc when compiling, comment out the phase-->
            <phase>compile</phase>
            <goals>
                <!--smart-doc provides goals like html, openapi, markdown, etc., which can be configured as needed-->
            </goals>
        </execution>
    </executions>
</plugin>
@inernoro inernoro added the bug Something isn't working label Apr 15, 2022
@shalousun
Copy link
Collaborator

shalousun commented Apr 15, 2022

@inernoro This configuration option only affects HTML and Markdown, which can be directly displayed.

shalousun added a commit that referenced this issue Apr 15, 2022
@inernoro inernoro reopened this Apr 18, 2022
@shalousun shalousun changed the title 当 requestExample 设置为 false 时,样例数据无法移除 When 'requestExample' is set to false, the sample data cannot be removed. Jul 2, 2024
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

No branches or pull requests

2 participants