jason-fox / fox.jason.passthrough.swagger

Generate DITA-based REST API documentation from a Swagger file added directly to a ditamap
https://jason-fox.github.io/dita-ot-plugins/swagger
Apache License 2.0
6 stars 4 forks source link

Swagger to DITA - Issue on Windows #2

Closed dan-lopes closed 4 years ago

dan-lopes commented 4 years ago

Hi Jason,

Firstly, let me thank you for writing this plugin. It is very useful!

I am having an issue when trying to convert a swagger json file to DITA on Windows. A similar setup running on linux (docker) works fine. I am using your sample ditamap and the petstore json as a test.

This is the command line and output:

dita --input test_swagger_json.ditamap -output ./converted_json --format dita -v > log.txt
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.1\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.1\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.1\plugins\fox.jason.passthrough\resource\antlib.xml:66: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\

I also attached a zip containing the ditamap, json and log files. files.zip

I am using:

Please let me know if I am doing anything wrong.

Thank you, Dan

jason-fox commented 4 years ago

Maybe this is related: https://stackoverflow.com/questions/34129054/patternsyntaxexception-unexpected-internal-error-near-index-1-for-splitfile

Try running:

java -version

From a CMD prompt. Maybe you still have Java 7.

aidanreilly commented 4 years ago

Seeing the same error on Windows 10, OT 3.5.2. my Java version is

java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

jason-fox commented 4 years ago

Next possibility, perhaps this is/was a bug in the swagger2markup-cli-1.3.3 library, I've just updated the dependency to swagger2markup-cli-2.0.0 (newly released in June 2020) - could you try reinstalling and see if the library update fixes the issue:

dita install https://github.com/jason-fox/fox.jason.passthrough.swagger/archive/master.zip

I've also amended the split function to be more Windows friendly 9fcb36b

dan-lopes commented 4 years ago

Hi Jason, thanks for that. However, I still see the same error.

swagger.process:
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:66: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\

I updated DITA-OT to 3.5.2 and installed the latest plugins.

My java version is:

java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
jason-fox commented 4 years ago

Try replacing /plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar with this debug version and run again. This should supply the stack trace of the error to help track it down further.

aidanreilly commented 4 years ago

Thanks Jason. I updated the jar and ran with the --verbose --debug switches. See below.

C:\dita-ot-3.5.2>dita --input=C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-pdf\document.ditamap --format=pdf --verbose -o out --debug

...

swagger.process.pre:
parsing buildfile jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar!/fox/jason/swagger/antlib.xml with URI = jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar!/fox/jason/swagger/antlib.xml from a zip file
 [macrodef] creating macro  add-swagger-file
parsing buildfile jar:file:/C:/dita-ot-3.5.2/bin/../plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar!/fox/jason/swagger/antlib.xml with URI = jar:file:/C:/dita-ot-3.5.2/bin/../plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar!/fox/jason/swagger/antlib.xml from a zip file
 [macrodef] creating macro  add-swagger-file

pandoc.check:
   [pandoc] Current OS is Windows 10
   [pandoc] Output redirected to property: pandoc.out
   [pandoc] Executing 'cmd' with arguments:
   [pandoc] '/C'
   [pandoc] 'pandoc -v'
   [pandoc]
   [pandoc] The ' characters around the executable and arguments are
   [pandoc] not part of the command.
   [pandoc] pandoc.exe 2.10.1
   [pandoc] Compiled with pandoc-types 1.21, texmath 0.12.0.2, skylighting 0.8.5
   [pandoc] Default user data directory: C:\Users\jreillai\AppData\Roaming\pandoc
   [pandoc] Copyright (C) 2006-2020 John MacFarlane
   [pandoc] Web:  https://pandoc.org
   [pandoc] This is free software; see the source for copying conditions.
   [pandoc] There is no warranty, not even for merchantability or fitness
   [pandoc] for a particular purpose.
parsing buildfile file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.pandoc/resource/antlib.xml with URI = file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.pandoc/resource/antlib.xml
 [macrodef] creating macro  add-pandoc-file
 [macrodef] creating macro  process-pandoc-errors
 [macrodef] creating macro  process-pandoc-images

passthrough.init:
parsing buildfile file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/resource/antlib.xml with URI = file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/resource/antlib.xml
parsing buildfile jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml with URI = jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml from a zip file
parsing buildfile jar:file:/C:/dita-ot-3.5.2/bin/../plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml with URI = jar:file:/C:/dita-ot-3.5.2/bin/../plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml from a zip file
 [macrodef] creating macro  passthrough-iterate
 [macrodef] creating macro  dita-passthrough
 [macrodef] creating macro  get-metadata
 [macrodef] creating macro  process-passthrough

swagger.process:
[read-ditamap] Reading C:\Users\jreillai\AppData\Local\Temp\temp20200812220321038/bd48640d7a7001fc4a2d735d12c9185511201799.ditamap
[read-ditamap] Executing xmltask 1.16
[read-ditamap] Processing C:\Users\jreillai\AppData\Local\Temp\temp20200812220321038/bd48640d7a7001fc4a2d735d12c9185511201799.ditamap [no output document]
[read-ditamap] Using predefined xml catalog
[read-ditamap] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@1d988297 to //*[@dita-ot:orig-format='swagger']
[read-ditamap] Calling internal macro for [chapter: null]
  [antcall] Exiting C:\dita-ot-3.5.2\build.xml.
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:66: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\

C:\dita-ot-3.5.2>
jason-fox commented 4 years ago

I still need more debug - try Try replacing /plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar again with this more verbose version. For some reason the error didn't catch the stack trace last time. 😞

aidanreilly commented 4 years ago

Thanks for being so responsive on this Jason. See below:

C:\dita-ot-3.5.2>dita --input=C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-pdf\document.ditamap --format=pdf --verbose --debug -o out

....

passthrough.init:
parsing buildfile file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/resource/antlib.xml with URI = file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/resource/antlib.xml
parsing buildfile jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml with URI = jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml from a zip file
parsing buildfile jar:file:/C:/dita-ot-3.5.2/bin/../plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml with URI = jar:file:/C:/dita-ot-3.5.2/bin/../plugins/fox.jason.passthrough/lib/passthrough.parser-2.0.jar!/fox/jason/passthrough/antlib.xml from a zip file
 [macrodef] creating macro  passthrough-iterate
 [macrodef] creating macro  dita-passthrough
 [macrodef] creating macro  get-metadata
 [macrodef] creating macro  process-passthrough

swagger.process:
[read-ditamap] Reading C:\Users\jreillai\AppData\Local\Temp\temp20200813090712899/bd48640d7a7001fc4a2d735d12c9185511201799.ditamap
[read-ditamap] Executing xmltask 1.16
[read-ditamap] Processing C:\Users\jreillai\AppData\Local\Temp\temp20200813090712899/bd48640d7a7001fc4a2d735d12c9185511201799.ditamap [no output document]
[read-ditamap] Using predefined xml catalog
[read-ditamap] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@1d988297 to //*[@dita-ot:orig-format='swagger']
[read-ditamap] Calling internal macro for [chapter: null]
  [antcall] Exiting C:\dita-ot-3.5.2\build.xml.
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:66: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\

C:\dita-ot-3.5.2>
jason-fox commented 4 years ago

That looks nothing like the debug output I've got.

./bin/dita -i plugins/fox.jason.passthrough.swagger/test/output-html/document.ditamap -o ../out -v -f html5
swagger.process:
[format-swagger-markdown] start: /var/folders/79/f71dhgdd4nz6hyv8p173ypb40000gn/T/temp20200813103843951/null508709387
execute1
execute1
moveAnchors1
moveAnchors2
line: # Swagger Petstore
line: 
line: 
line: <a name="overview"></a>
line: ## Overview
line: This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters.
line:

... etc

line: <a name="api_key"></a>
line: ### api_key
line: *Type* : apiKey  
line: *Name* : api_key  
line: *In* : HEADER
moveAnchors4
execute3
execute4
[format-swagger-markdown] end
   [pandoc] Processing /var/folders/79/f71dhgdd4nz6hyv8p173ypb40000gn/T/temp20200813103843951/null508709387.md
[file-rename] Moving 1 file to /var/folders/79/f71dhgdd4nz6hyv8p173ypb40000gn/T/temp20200813103843951

passthrough.process:

Could you try reinstalling /plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar with this debug version again. Delete the existing jar and maybe run dita install again? To get the right commit make sure you download using this URL: https://github.com/jason-fox/fox.jason.passthrough.swagger/raw/300d6e98240bb264727438bedc1e2327bd2c9922/lib/passthrough.swagger-1.1.jar

aidanreilly commented 4 years ago

dita --input=C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-html\document.ditamap --format=html5 --verbose --debug -o out

gives similar to my previously posted output. I've deleted and applied your jar above a number of times, no change...

jason-fox commented 4 years ago

Oh the joys of trying to remotely debug an unknown operating system issue via GitHub issues. 😄

The debug jar is definitely available, maybe try using DITA-OT to load it instead.

./bin/dita --uninstall fox.jason.passthrough.swagger  
./bin/dita install https://github.com/jason-fox/fox.jason.passthrough.swagger/archive/debug.zip
./bin/dita -i plugins/fox.jason.passthrough.swagger/test/output-html/document.ditamap -o ../out -v -f html5

I've just done this myself and it works on Mac (locally) and CI on Unix :smile:

aidanreilly commented 4 years ago

Thanks Jason, :) I tried the above in OXygen instead of the command line, and i think I get the debug details you were looking for in Oxygen.

See below - same error with a twist of debug detail on top..

Anecdotally, have you heard of others using this plugin on windows sucessfully?

Executing:
"c:\users\jreillai\appdata\local\oxygen xml editor 20\jre/bin/java" -Dfile.encoding=UTF-8 -Xmx384m "-Doxygen.org.apache.xerces.xni.parser.XMLParserConfiguration=org.ditang.relaxng.defaults.RelaxDefaultsParserConfiguration" -classpath "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\tools\ant/lib/ant-launcher.jar" "-Dant.home=C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\tools\ant" org.apache.tools.ant.launch.Launcher -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.common\lib\jaxb-api-2.3.0.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.common\lib\jaxb-core-2.3.0.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.common\lib\jaxb-impl-2.3.0.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.common\lib\activation-1.1.1.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.common\lib\ant-contrib-1.0b3.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.dost.patches\lib\oxygen-dost-patches.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\com.oxygenxml.highlight\lib\xslthl-2.1.1.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough\lib\passthrough.parser-2.0.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\lib\swagger2markup-cli-2.0.0.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\lib\passthrough.swagger-1.1.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.htmlhelp\lib\htmlhelp.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2\lib\fo.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.axf\lib\axf.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\oxygen-patches-fop.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\oxygen-patches-batik.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\avalon-framework-api-4.3.1.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\avalon-framework-impl-4.3.1.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\batik-all-1.10.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\fontbox-2.0.7.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\fop-2.3.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\jcl-over-slf4j-1.7.25.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\xml-apis-ext-1.3.04.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.fop\lib\xmlgraphics-commons-2.3.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.dita.pdf2.xep\lib\xep.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.doctales.xmltask\lib\xmltask.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\org.lwdita-2.0.5.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\htmlparser-1.4.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-profile-pegdown-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-abbreviation-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-anchorlink-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-aside-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-autolink-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-definition-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-html-parser-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-escaped-character-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-footnotes-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-jira-converter-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-youtrack-converter-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-gfm-strikethrough-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-gfm-tables-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-gfm-tasklist-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-jekyll-front-matter-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-jekyll-tag-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-ins-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-superscript-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-tables-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-toc-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-typographic-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-wikilink-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-ext-yaml-front-matter-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-formatter-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\flexmark-util-0.32.24.jar" -lib "C:\dita-tools\dita-ot-3.x\plugins\org.lwdita\lib\autolink-0.6.0.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\saxon-9.1.0.8-dom.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\saxon-9.1.0.8.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\commons-io-2.6.jar" -lib "C:\dita-tools\dita-ot-3.x\config" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\classes" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygen.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygenAuthor.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygenDeveloper.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygenEclipse.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygenAuthorEclipse.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygenDeveloperEclipse.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygen-basic-utilities.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\resolver.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygen-token-markers.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\org.eclipse.wst.xml.xpath2.processor_1.2.0.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\xml-apis.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\xercesImpl.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\commons-io-1.3.1.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\commons-logging-1.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\log4j.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\jing.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\saxon9ee.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\saxon.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\xmlgraphics-commons-2.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\fop.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\fontbox-2.0.4.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\pdfbox-2.0.4.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\fop-pdf-images-2.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\batik-all-1.9.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\js.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\poi-3.10-FINAL-20140208.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\nekohtml.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\xml-apis-ext.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\avalon-framework-api-4.3.1.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\avalon-framework-impl-4.3.1.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\jeuclid-core.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\jeuclid-fop.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\oxygen-jai-tiff.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\jh.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\jsearch.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-analyzers-common-4.7.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-analyzers-kuromoji-4.7.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-core-4.7.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-misc-4.7.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-queries-4.7.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-queryparser-4.7.2.jar" -lib "C:\Users\jreillai\AppData\Local\Oxygen XML Editor 20\lib\lucene-suggest-4.7.2.jar" -lib "C:\dita-tools\dita-ot-3.x" -lib "C:\dita-tools\dita-ot-3.x\target\classes" -lib "C:\dita-tools\dita-ot-3.x\lib" -lib "C:\dita-tools\dita-ot-3.x\lib\animal-sniffer-annotations-1.14.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\ant-apache-resolver-1.10.1.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\ant-apache-resolver-1.10.3.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\ant-launcher.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\ant.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\checker-qual-2.0.0.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\dost-configuration.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\dost.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\error_prone_annotations-2.1.3.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\guava-25.1-jre.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\icu4j-61.1.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\j2objc-annotations-1.1.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\jsr305-3.0.2.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\logback-classic-1.2.3.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\logback-core-1.2.3.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\slf4j-api-1.7.25.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\xercesImpl-2.11.0.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\xml-apis-1.4.01.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\xml-resolver-1.2.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\xmltask.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\xom-1.1.jar" -lib "C:\dita-tools\dita-ot-3.x\lib\xpathtask.jar" -f "C:\dita-tools\dita-ot-3.x/build.xml" "-Dtranstype=html5" "-Dbasedir=C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\test\output-html" "-Doutput.dir=C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\test\output-html/out/html5" "-Ddita.temp.dir=C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\test\output-html/temp/html5" "-Dargs.input=C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\test\output-html\document.ditamap" "-Ddita.dir=C:\dita-tools\dita-ot-3.x" "-DbaseJVMArgLine=-Xmx384m"

BUILD FAILED
C:\dita-tools\dita-ot-3.x\build.xml:45: The following error occurred while executing this line:
C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough.swagger\process_swagger.xml:23: The following error occurred while executing this line:
C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-tools\dita-ot-3.x\plugins\fox.jason.passthrough\resource\antlib.xml:66: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
    at java.util.regex.Pattern.error(Unknown Source)
    at java.util.regex.Pattern.compile(Unknown Source)
    at java.util.regex.Pattern.<init>(Unknown Source)
    at java.util.regex.Pattern.compile(Unknown Source)
    at java.lang.String.replaceAll(Unknown Source)
    at fox.jason.passthrough.tasks.WindowsJobXmlResultTask.execute(WindowsJobXmlResultTask.java:70)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at java.util.Vector.forEach(Unknown Source)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
    at com.oopsconsultancy.xmltask.AnonymousCallAction.apply(AnonymousCallAction.java:107)
    at com.oopsconsultancy.xmltask.XmlReplace.apply(XmlReplace.java:78)
    at com.oopsconsultancy.xmltask.XmlReplacement.apply(XmlReplacement.java:61)
    at com.oopsconsultancy.xmltask.ant.XmlTask.processDoc(XmlTask.java:692)
    at com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java:661)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at java.util.Vector.forEach(Unknown Source)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
    at fox.jason.passthrough.tasks.DitamapsPassthroughTask.execute(DitamapsPassthroughTask.java:117)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at java.util.Vector.forEach(Unknown Source)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:448)
    at org.apache.tools.ant.Target.performTasks(Target.java:469)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:446)
    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:448)
    at org.apache.tools.ant.Target.performTasks(Target.java:469)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1370)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
    at org.apache.tools.ant.Main.runBuild(Main.java:849)
    at org.apache.tools.ant.Main.startAnt(Main.java:228)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)

Total time: 4 seconds

The process finished with exit code: 1
jason-fox commented 4 years ago

Same issue (inconsistent regex handling on versions of windows), different plugin. You'll need to reinstall the fox.jason.passthrough plugin for latest as well. see: https://github.com/jason-fox/fox.jason.passthrough/commit/6a731c32bc022239054f48fabbd5da0d66a1768a

./bin/dita --uninstall fox.jason.passthrough
./bin/dita install https://github.com/jason-fox/fox.jason.passthrough/archive/master.zip

Anecdotally, have you heard of others using this plugin on windows successfully?

The issue stems from the rewrite of the plugins from JavaScript to Java since the Rhino engine is due to be deprecated in Java 14. The older version was working on Windows, and still is in some cases (but not in others I guess)

aidanreilly commented 4 years ago

OK, so now we have: the following. Looking for dtds in the wrong place?

Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:67: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:74: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:145: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:111: C:\dita-ot-3.5.2\bookmap.dtd (The system cannot find the file specified)
dan-lopes commented 4 years ago

Thanks for looking into this, Jason.

I have the same issue here.

bookmap.dtd (The system cannot find the file specified)
jason-fox commented 4 years ago

That is the catalog path not being found on Windows - workaround added (hopefully) see: https://github.com/jason-fox/fox.jason.passthrough/commit/12dbaf31 and https://github.com/jason-fox/fox.jason.translate.xliff/issues/1

./bin/dita --uninstall fox.jason.passthrough
./bin/dita install https://github.com/jason-fox/fox.jason.passthrough/archive/master.zip
aidanreilly commented 4 years ago

👍 Well the error messages are changing, so that's progress right?

swagger.process:
[read-ditamap] Reading C:\Users\jreillai\AppData\Local\Temp\temp20200813203724440/document.ditamap
[read-ditamap] Executing xmltask 1.16
[read-ditamap] Processing C:\Users\jreillai\AppData\Local\Temp\temp20200813203724440/document.ditamap [no output document]
[read-ditamap] Using predefined xml catalog
[read-ditamap] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@38b7004d to //*[@dita-ot:orig-format='swagger']
[read-ditamap] Calling internal macro for [chapter: null]
[read-job.xml] Reading C:\Users\jreillai\AppData\Local\Temp\temp20200813203724440\.job.xml
[read-job.xml] Executing xmltask 1.16
[read-job.xml] Processing C:\Users\jreillai\AppData\Local\Temp\temp20200813203724440\.job.xml [no output document]
[read-job.xml] Using predefined xml catalog
[read-job.xml] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@4529048e to //file[@result='file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/test/output-html/swagger.json']
[read-job.xml] Calling internal macro for [file: null]
[check-metadata] Reading C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-html\document.ditamap
[check-metadata] Executing xmltask 1.16
[check-metadata] Processing C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-html\document.ditamap [no output document]
[check-metadata] Using predefined xml catalog
Apache resolver library found, xml-commons resolver will be used
[check-metadata] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@41dc34c8 to //*[@href='swagger.json']/topicmeta
[check-metadata] Applied com.oopsconsultancy.xmltask.AnonymousCallAction@41dc34c8 - 0 match(es)
[check-metadata] com.oopsconsultancy.xmltask.AnonymousCallAction@41dc34c8 (//*[@href='swagger.json']/topicmeta) failed to match
[antcall] Exiting C:\dita-ot-3.5.2\build.xml.
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:67: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:74: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:148: java.lang.NoSuchMethodError: java.net.URLDecoder.decode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;
jason-fox commented 4 years ago

Yes, minor progress. My bad - I needed to use the old style Java 8 url encoding function - see: https://github.com/jason-fox/fox.jason.passthrough/commit/cd91626b40e2f16a44dde012bad3236a9dfe0d11 .

./bin/dita --uninstall fox.jason.passthrough
./bin/dita install https://github.com/jason-fox/fox.jason.passthrough/archive/master.zip

Try again, fail again, fail better.

aidanreilly commented 4 years ago

and again :) I feel like we're nearly there....

swagger.process:
[read-ditamap] Reading C:\Users\jreillai\AppData\Local\Temp\temp20200814084108109/document.ditamap
[read-ditamap] Executing xmltask 1.16
[read-ditamap] Processing C:\Users\jreillai\AppData\Local\Temp\temp20200814084108109/document.ditamap [no output document]
[read-ditamap] Using predefined xml catalog
[read-ditamap] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@38b7004d to //*[@dita-ot:orig-format='swagger']
[read-ditamap] Calling internal macro for [chapter: null]
[read-job.xml] Reading C:\Users\jreillai\AppData\Local\Temp\temp20200814084108109\.job.xml
[read-job.xml] Executing xmltask 1.16
[read-job.xml] Processing C:\Users\jreillai\AppData\Local\Temp\temp20200814084108109\.job.xml [no output document]
[read-job.xml] Using predefined xml catalog
[read-job.xml] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@4529048e to //file[@result='file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/test/output-html/swagger.json']
[read-job.xml] Calling internal macro for [file: null]
[check-metadata] Reading C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-html\document.ditamap
[check-metadata] Executing xmltask 1.16
[check-metadata] Processing C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\output-html\document.ditamap [no output document]
[check-metadata] Using predefined xml catalog
Apache resolver library found, xml-commons resolver will be used
[check-metadata] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@41dc34c8 to //*[@href='swagger.json']/topicmeta
[check-metadata] Applied com.oopsconsultancy.xmltask.AnonymousCallAction@41dc34c8 - 0 match(es)
[check-metadata] com.oopsconsultancy.xmltask.AnonymousCallAction@41dc34c8 (//*[@href='swagger.json']/topicmeta) failed to match
[swagger-gen] Executing 'C:\Program Files\Java\jdk1.8.0_191\jre\bin\java.exe' with arguments:
[swagger-gen] '-Xmx128m'
[swagger-gen] '-jar'
[swagger-gen] 'C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\lib\swagger2markup-cli-2.0.0.jar'
[swagger-gen] 'convert'
[swagger-gen] '-i'
[swagger-gen] '/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/test/output-html/swagger.json'
[swagger-gen] '-f'
[swagger-gen] 'C:\Users\jreillai\AppData\Local\Temp\temp20200814084108109\null273599538'
[swagger-gen] '-c'
[swagger-gen] 'C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger/cfg/config.properties'
[swagger-gen]
[swagger-gen] The ' characters around the executable and arguments are
[swagger-gen] not part of the command.
[swagger-gen] Output redirected to property: swagger.output
[swagger-gen] Error redirected to property: swagger.error
[swagger-gen] Java Result: 1
[swagger-gen] Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/test/output-html/swagger.json
[swagger-gen]   at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
[swagger-gen]   at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[swagger-gen]   at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[swagger-gen]   at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
[swagger-gen]   at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
[swagger-gen]   at java.nio.file.Paths.get(Paths.java:84)
[swagger-gen]   at io.github.swagger2markup.utils.URIUtils.create(URIUtils.java:57)
[swagger-gen]   at io.github.swagger2markup.cli.Application.run(Application.java:77)
[swagger-gen]   at io.github.swagger2markup.cli.Application.main(Application.java:61)
  [antcall] Exiting C:\dita-ot-3.5.2\build.xml.
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:67: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:74: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:148: The following error occurred while executing this line:
jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar!/fox/jason/swagger/antlib.xml:63: [SWAG001F][FATAL] SwaggerGen failed to generate documentation: /C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/test/output-html/swagger.json. Check that your swagger file is valid.
jason-fox commented 4 years ago

Getting there slowly. That / prefix needs fixing next. https://github.com/jason-fox/fox.jason.passthrough/commit/96ad22db6502a01f8f4ef20a04f5cbb5d520db6e (hopefully)

./bin/dita --uninstall fox.jason.passthrough
./bin/dita install https://github.com/jason-fox/fox.jason.passthrough/archive/master.zip
aidanreilly commented 4 years ago

aaand, there we go :) output successful. thanks for hanging in there Jason. Now to put this through it's paces. Happy Friday :)

jason-fox commented 4 years ago

@aidanreilly - does the master / non-debug version work for you?

./bin/dita --uninstall fox.jason.passthrough.swagger  
./bin/dita install https://github.com/jason-fox/fox.jason.passthrough.swagger/archive/master.zip
dan-lopes commented 4 years ago

All good on my end too. Thank you very much.

aidanreilly commented 4 years ago

I get the following error for the complex-test.ditamap:

dita -i C:\dita-ot-3.5.2\plugins\fox.jason.passthrough.swagger\test\swagger-complex\document.ditamap -f html5 -o out

[swagger-gen] Java Result: 1
[swagger-gen] Exception in thread "main" java.lang.NullPointerException
[swagger-gen]   at io.github.swagger2markup.internal.component.ResponseComponent.lambda$apply$1(ResponseComponent.java:104)
[swagger-gen]   at java.util.TreeMap.forEach(TreeMap.java:1005)
[swagger-gen]   at io.github.swagger2markup.internal.component.ResponseComponent.apply(ResponseComponent.java:88)
[swagger-gen]   at io.github.swagger2markup.internal.component.PathOperationComponent.buildResponsesSection(PathOperationComponent.java:233)
[swagger-gen]   at io.github.swagger2markup.internal.component.PathOperationComponent.apply(PathOperationComponent.java:112)
[swagger-gen]   at io.github.swagger2markup.internal.document.PathsDocument.applyPathOperationComponent(PathsDocument.java:236)
[swagger-gen]   at io.github.swagger2markup.internal.document.PathsDocument.buildOperation(PathsDocument.java:220)
[swagger-gen]   at io.github.swagger2markup.internal.document.PathsDocument.lambda$buildsPathsSection$0(PathsDocument.java:120)
[swagger-gen]   at java.util.ArrayList.forEach(ArrayList.java:1257)
[swagger-gen]   at io.github.swagger2markup.internal.document.PathsDocument.buildsPathsSection(PathsDocument.java:120)
[swagger-gen]   at io.github.swagger2markup.internal.document.PathsDocument.apply(PathsDocument.java:104)
[swagger-gen]   at io.github.swagger2markup.Swagger2MarkupConverter.applyPathsDocument(Swagger2MarkupConverter.java:201)
[swagger-gen]   at io.github.swagger2markup.Swagger2MarkupConverter.toFile(Swagger2MarkupConverter.java:244)
[swagger-gen]   at io.github.swagger2markup.cli.Application.run(Application.java:84)
[swagger-gen]   at io.github.swagger2markup.cli.Application.main(Application.java:61)
Error: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:23: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:55: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:67: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:74: The following error occurred while executing this line:
C:\dita-ot-3.5.2\plugins\fox.jason.passthrough\resource\antlib.xml:148: The following error occurred while executing this line:
jar:file:/C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/lib/passthrough.swagger-1.1.jar!/fox/jason/swagger/antlib.xml:63: [SWAG001F][FATAL] SwaggerGen failed to generate documentation: C:/dita-ot-3.5.2/plugins/fox.jason.passthrough.swagger/test/swagger-complex/swagger.json. Check that your swagger file is valid.
jason-fox commented 4 years ago

There is a reason why that test is disabled - the java.lang.NullPointerException is a failure in the external swagger2markup-cli-1.3.3 lib (and still is in swagger2markup-cli-2.0.0)

aidanreilly commented 4 years ago

OK, so does that mean incomplete coverage for openAPI json?

jason-fox commented 4 years ago

No, it means someone supplied me with an invalid swagger file to test and I hadn't discovered the underlying issue until today. On further investigation if not sending headers it looks like it is better to leave out the header definition altogether rather than defining an empty object.

i.e. don't do this:

get:
  responses:
     '200':
        description: OK
        headers: {}
        schema: {}

do this:

 get:
    responses:
       '200':
          description: OK

swagger2markup-cli-2.0.0 can't cope with it.

jason-fox commented 4 years ago

Fixed in new release: https://github.com/jason-fox/fox.jason.passthrough.swagger/releases/tag/v1.3.0