Skip to content

Error Generating HTML Files in Solon Environment #978

@853103174

Description

@853103174

Contact Details

No response

Version

3.0.9

Plugin

smart-doc-maven-plugin

Build tool version

maven 3.9.9

Jdk version

21

Describe the bug (Bug描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

java.lang.NullPointerException: Cannot invoke "com.ly.doc.model.annotation.RequestPartAnnotation.getAnnotationName()" because the return value of "com.ly.doc.model.annotation.FrameworkAnnotations.getRequestPartAnnotation()" is null
    at com.ly.doc.template.IRestDocTemplate.requestParams (IRestDocTemplate.java:1029)
    at com.ly.doc.template.IRestDocTemplate.buildEntryPointMethod (IRestDocTemplate.java:845)
    at com.ly.doc.template.IRestDocTemplate.processApiData (IRestDocTemplate.java:174)
    at com.ly.doc.template.SolonDocBuildTemplate.renderApi (SolonDocBuildTemplate.java:61)
    at com.ly.doc.template.IDocBuildTemplate.getApiData (IDocBuildTemplate.java:56)
    at com.ly.doc.builder.HtmlApiDocBuilder.buildApiDoc (HtmlApiDocBuilder.java:90)
    at com.ly.doc.plugin.mojo.HtmlMojo.executeMojo (HtmlMojo.java:48)
    at com.ly.doc.plugin.mojo.BaseDocsGeneratorMojo.execute (BaseDocsGeneratorMojo.java:163)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:41)

Expected Behavior (您期望的结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

  1. Can generate HTML documents correctly
  2. Solon-3.0.4 configuration supports placing @ Post and @ Get annotations on classes
  3. 3.0.5 can generate documents, but it does not support the post configuration mentioned above. How to configure Content Type? I want to change the post to application/json

Current Behavior (当前结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

Generate error and do not support expected results

Steps to Reproduce (Bug产生步骤,请尽量提供用例代码。社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

  1. Generate documents using idea2024.2.3 plugin
  2. The configuration of smart-doc.json is as follows
{
  "framework": "solon",
  "outPath": "src/main/resources/static/doc",
  "packageFilters": "com.sfzx.hospital.interfaces.controller.passport.PassportCmdExe",
  "requestHeaders": [
    {
      "name": "X-Access-Token",
      "type": "string",
      "desc": "访问令牌",
      "value": "",
      "required": true,
      "pathPatterns": "/**"
    },
    {
      "name": "X-Platform-Model",
      "type": "string",
      "desc": "操作系统",
      "value": "app",
      "required": true,
      "pathPatterns": "/**"
    }
  ]
}

Possible Solution (Bug解决建议,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

No response

Context (Bug影响描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

No response

Validations

  • Check if you're on the latest smart-doc version. (请检查是否为最新版本)
  • Read the docs. (请先阅读官方文档)
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. (检查是否存在报告相同错误的问题,以避免产生重复)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions