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

Request-body can't be edited in the debug page when using Firefox #572

Open
abing22333 opened this issue Aug 10, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@abing22333
Copy link
Contributor

Your Environment(您的使用环境)

  • smart-doc version: 2.7.4
  • plugin version (e.g. smart-doc-maven-plugin or smart-doc-gradle-plugin): smart-doc-maven-plugin
  • build tool version(maven or gradle): maven

Expected Behavior(您期望的结果)

As described in the official website, I can edit the Request body。

Current Behavior(当前结果)

Request-body can't be edited in debug page

Possible Solution(bug解决建议)

Steps to Reproduce (Bug产生步骤,请尽量提供用例代码)

  1. Code
public class User   { 

    private Integer userId; 
    /**
     * 用户姓名
     */
    private String userName;
    /**
     * 性别,1-男,2-女
     */
    private Integer sex;
    /**
     * 年龄
     */
    private Integer age;

  // ignore  getter, setter and constructor 
}
/**
 * 用户管理
 *
 * @author abing
 * @since 2023-08-06 21:18:29
 */
@RestController
@RequestMapping("user")
public class UserController {

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("{id}")
    public User queryById(@PathVariable("id") Integer id) {
        return null;
    }

    /**
     * 新增数据
     *
     * @param user 实体
     * @return 新增结果
     */
    @PostMapping
    public User add(@RequestBody User user) {
        return null;
    } 
}
  1. config

smart-doc.json

{
  "outPath": "src/main/resources/static/doc",
  "allInOne": true,
  "projectName": "用户管理",
  "allInOneDocFileName": "index.html",
  "createDebugPage": true,
  "serverUrl": "http://localhost:8080"
}

pom.xml

         <plugin>
                <groupId>com.github.shalousun</groupId>
                <artifactId>smart-doc-maven-plugin</artifactId>
                <version>2.7.4</version>
                <configuration>
                    <!--  指定smart-doc配置文件 -->
                    <configFile>./src/main/resources/smart-doc.json</configFile>
                </configuration>
            </plugin>
  1. use
mvn -Dfile.encoding=UTF-8 smart-doc:html

5 result

The path-parameters is editable.

image

the request-body is not editable

image

Context(Bug影响描述)

This bug is serious and blocks debug

@abing22333 abing22333 added the bug Something isn't working label Aug 10, 2023
@abing22333
Copy link
Contributor Author

abing22333 commented Aug 11, 2023

It's just that Firefox doesn't support editing.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable

image

@abing22333 abing22333 changed the title Request-body can't be edited in debug page Request-body can't be edited in the debug page when using Firefox Aug 11, 2023
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