当前位置: 首页 > 知识库问答 >
问题:

为flutter项目创建DART包时出错

梁宏才
2023-03-14

编辑:我编辑了我的大摇大摆的路径。但我现在正处于错误以下。

[main] INFO io.swagger.parser.Swagger20Parser - reading from https://SWAGGERFILE/api
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://SWAGGERFILE/api
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
    at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:764)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:299)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
java -jar /Users/PATH/modules/swagger-codegen-cli/src/main/target/swagger-codegen-cli.jar generate -i https://SWAGGERFILE/api-docs/#/ -l dart -o /Users/PATH/STORE/DART/PACKAGE
 java -jar /Users/PATH/modules/swagger-codegen-cli/src/main/target/swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l dart -o /Users/PATH/STORE/DART/PACKAGE
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://SWAGGERFILE/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content  (maxDepth 2000)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
    at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
    at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
    at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
    at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
    at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:69)
    at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
 in 'string', line 14, column 17:
          box-sizing: border-box;
                    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
    at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
    at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
    ... 10 more
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://production.user-api.api.findnemo.in/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content  (maxDepth 2000)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
    at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
    at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
    at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
    at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
    at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
    at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
 in 'string', line 14, column 17:
          box-sizing: border-box;
                    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
    at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
    at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
    ... 10 more
[main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Swagger UI</title>
  <link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
  <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />

  <style>
    html
    {
      box-sizing: border-box;
      overflow: -moz-scrollbars-vertical;
      overflow-y: scroll;
    }"[truncated 2632 chars]; line: 2, column: 2]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1917)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:773)
    at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4231)
    at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2711)
    at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:194)
    at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
    at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
    at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
    at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:764)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:299)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
shwetadodiya@shwetas-MBP swagger-codegen-master % java -jar /Users/shwetadodiya/Documents/FlutterProjects/Swagger/swagger-codegen-master/modules/swagger-codegen-cli/src/main/target/swagger-codegen-cli.jar generate -i https://production.user-api.api.findnemo.in/api-docs/#/ -l dart -o /Users/shwetadodiya/Documents/FlutterProjects/Swagger/SwaggerCode 
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://production.user-api.api.findnemo.in/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content  (maxDepth 2000)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
    at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
    at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
    at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
    at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
    at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:69)
    at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
 in 'string', line 14, column 17:
          box-sizing: border-box;
                    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
    at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
    at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
    ... 10 more
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://production.user-api.api.findnemo.in/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content  (maxDepth 2000)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
    at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
    at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
    at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
    at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
    at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
    at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
 in 'string', line 14, column 17:
          box-sizing: border-box;
                    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
    at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
    at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
    at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
    ... 10 more
[main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Swagger UI</title>
  <link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
  <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />

  <style>
    html
    {
      box-sizing: border-box;
      overflow: -moz-scrollbars-vertical;
      overflow-y: scroll;
    }"[truncated 2632 chars]; line: 2, column: 2]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1917)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:773)
    at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4231)
    at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2711)
    at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:194)
    at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
    at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
    at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
    at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:764)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:299)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)

共有1个答案

公羊英达
2023-03-14

-i参数需要OpenAPI YAML/JSON文件的路径。看起来https://swaggerfile/api-docs/#/指向的是一个HTML页面(例如Swagger UI),而不是实际的OpenAPI YAML/JSON文件。

如果您使用Swagger UI,以下是如何获得YAML/JSON文件链接的方法:
如何从Swagger UI导出Swagger JSON/YAML文件?

 类似资料:
  • 我在Eclipse中创建maven项目时遇到了一个问题。发生以下错误: 无法计算生成计划:Plugin org.apache.maven。plugins:maven-resources-plugin:2.6或其一个依赖项无法解析:读取org.apache.maven的工件描述符失败。plugins:maven-resources-plugin:jar:2.6 pluginorg.apache.ma

  • 我有一个在macOS上使用< code > flutter _ libserialport 库的项目。我正在修改它,以在网络上工作,但这个库不能在网络上工作。 我正在使用javascript中的< code>navigator.serial构建一个web实现,效果很好。 然而,当我试图为web构建项目时,我得到了以下错误 这是有道理的,因为FFI在网络上不可用。 但我甚至不需要网络上的。 我怎样才

  • 问题内容: 当我尝试创建一个新的Maven项目(具有多个原型,不仅是下面的一个)时,我遇到此错误: 有谁知道为什么会这样,如何解决? 问题答案: 您的目录似乎不为空。此命令行对我有用:(在空目录中) 结果是: 我可以通过在新创建的目录中执行以下命令行来重现您的错误:

  • 我正在使用eclipse、m2eclipse插件和maven创建一个新的maven项目,遵循以下步骤,http://o7planning.org/en/10101/install-maven-into-eclipse 但是,当创建一个新的maven项目时,没有JRE系统库,也没有maven库。只有如下所示的src、target和pom.xml。这正常吗?如果没有,我该如何避免呢?谢谢! 单击以获取

  • 我已经在窗户上安装了颤振,并使用颤振医生检查了一切正常。我导入了Flutter插件。 第二次编辑: “颤振医生-V”输出

  • 我是科尔多瓦的新手,刚刚开始玩它。我希望有人有主意或者给我指明正确的方向。 执行以下命令时出现以下错误: (1)cordova创建HelloWorldcom.example.helloHelloWorld--Works (2)cd HelloWorld (3)cordova平台添加android-失败 C:\开发\工作空间\mobile\HelloWorld 现在我进行了搜索,发现如果create