Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Commit dfc7805

Browse files
0.3.0 (2022-11-27)
+ Changed parent pom version (fj-bom) to 0.2.2 * Updated documentation * Updated test case Merge branch 'develop'
2 parents d9cd976 + 306fc33 commit dfc7805

File tree

6 files changed

+155
-32
lines changed

6 files changed

+155
-32
lines changed

.gitignore

Lines changed: 106 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,106 @@
1-
/target/
2-
/.classpath
3-
/.project
4-
/.settings/
1+
### Idea Intellij ###
2+
.idea/
3+
*.iml
4+
5+
### Eclipse ###
6+
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.settings/
16+
.loadpath
17+
.recommenders
18+
19+
.vscode/
20+
21+
# Eclipse Core
22+
.project
23+
24+
# External tool builders
25+
.externalToolBuilders/
26+
27+
# Locally stored "Eclipse launch configurations"
28+
*.launch
29+
30+
# PyDev specific (Python IDE for Eclipse)
31+
*.pydevproject
32+
33+
# CDT-specific (C/C++ Development Tooling)
34+
.cproject
35+
36+
# JDT-specific (Eclipse Java Development Tools)
37+
.classpath
38+
39+
# Java annotation processor (APT)
40+
.factorypath
41+
42+
# PDT-specific (PHP Development Tools)
43+
.buildpath
44+
45+
# sbteclipse plugin
46+
.target
47+
48+
# Tern plugin
49+
.tern-project
50+
51+
# TeXlipse plugin
52+
.texlipse
53+
54+
# STS (Spring Tool Suite)
55+
.springBeans
56+
57+
# Code Recommenders
58+
.recommenders/
59+
60+
# Scala IDE specific (Scala & Java development for Eclipse)
61+
.cache-main
62+
.scala_dependencies
63+
.worksheet
64+
65+
### Java ###
66+
# Compiled class file
67+
*.class
68+
69+
# Log file
70+
*.log
71+
72+
# BlueJ files
73+
*.ctxt
74+
75+
# Mobile Tools for Java (J2ME)
76+
.mtj.tmp/
77+
78+
# Package Files #
79+
*.jar
80+
*.war
81+
*.ear
82+
*.zip
83+
*.tar.gz
84+
*.rar
85+
86+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
87+
hs_err_pid*
88+
89+
### Maven ###
90+
target/
91+
pom.xml.tag
92+
pom.xml.releaseBackup
93+
pom.xml.versionsBackup
94+
pom.xml.next
95+
release.properties
96+
dependency-reduced-pom.xml
97+
buildNumber.properties
98+
.mvn/timing.properties
99+
100+
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
101+
!/.mvn/wrapper/maven-wrapper.jar
102+
103+
# End of https://www.gitignore.io/api/java,maven,eclipse
104+
105+
/.apt_generated/
106+
/.apt_generated_tests/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
0.3.0 (2022-11-27)
2+
------------------
3+
+ Changed parent pom version (fj-bom) to 0.2.2
4+
* Updated documentation
5+
* Updated test case

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@ Tool for auto documentation of yaml / openapi
44

55
**Usage:**
66

7+
```
78
java -jar dist-yaml-doc-tool-X.X.X.jar --input-yaml [path-to-openapi]\
89
--output-file [output-file]\
910
--language [language]\
1011
--labels-override [path-to-labels-properties]
12+
```
1113
1214
**example :**
1315

14-
java -jar dist-yaml-doc-tool-0.1.0.jar --input-yaml sample.yaml --output-file sample.pdf --language it
16+
java -jar dist-yaml-doc-tool-0.3.0.jar --input-yaml sample.yaml --output-file sample.pdf --language it
1517

1618
**output-file**
17-
currently supported extensions : pdf, xlsx, xml
19+
currently supported extensions : pdf, xlsx, xml, fo
1820

1921
**language**
2022
currently supported languages : it, en
2123

2224
**labels-overrides**
2325
path to alternate labels properties
24-
currently supported labels are available in : src/main/resources/lang/label.properties
26+
currently supported labels are available in : src/main/resources/lang/label.properties
27+
28+
**maven plugin**
29+
A [Maven Plugin](https://github.com/fugerit-org/yaml-doc-maven-plugin) is also available.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-bom</artifactId>
10-
<version>0.1.1</version>
10+
<version>0.2.2</version>
1111
<relativePath></relativePath>
1212
</parent>
1313

14-
<version>0.2.4</version>
14+
<version>0.3.0</version>
1515
<packaging>jar</packaging>
1616

1717
<name>yaml-doc-tool</name>

src/test/java/test/org/fugerit/java/yaml/doc/TestYamlDocFacade.java

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,41 @@ public class TestYamlDocFacade {
2121

2222
private final static Logger logger = LoggerFactory.getLogger( TestYamlDocFacade.class );
2323

24-
//private static final Locale LOCALE = Locale.ENGLISH;
25-
private static final Locale LOCALE = Locale.ITALIAN;
26-
27-
public void testWorkerSample( String outputFormat ) {
28-
try ( Reader reader = new FileReader( "src/test/resources/sample/sample.yaml" );
29-
OutputStream os = new FileOutputStream( new File( "target/sample."+outputFormat ) )) {
30-
YamlDocConfig config = new YamlDocConfig( outputFormat );
31-
config.setLocale( LOCALE );
32-
config.setLabelsOverride( PropsIO.loadFromClassLoader( "sample/sample-label-override.properties" ) );
33-
config.setExcelTryAutoresize( true );
34-
YamlDocFacade facade = new YamlDocFacade();
35-
int result = facade.handle(reader, os, config);
36-
logger.info( "result -> {}", result );
37-
} catch (Exception e) {
38-
String message = "Error: "+e.getMessage();
39-
logger.error( message, e );
40-
fail( message );
24+
private static final Locale LOCALE_EN = Locale.ENGLISH;
25+
26+
private static final Locale LOCALE_IT = Locale.ITALIAN;
27+
28+
private static final String FILE_ENCODING = "utf-8";
29+
30+
public void testWorkerSample( Locale locale, String encoding, String... outputFormats ) {
31+
System.setProperty( "file.encoding", FILE_ENCODING );
32+
for ( String outputFormat : outputFormats ) {
33+
try ( Reader reader = new FileReader( "src/test/resources/sample/sample.yaml" );
34+
OutputStream os = new FileOutputStream( new File( "target/sample_"+locale+"."+outputFormat ) )) {
35+
YamlDocConfig config = new YamlDocConfig( outputFormat );
36+
config.setLocale( locale );
37+
config.setLabelsOverride( PropsIO.loadFromClassLoader( "sample/sample-label-override.properties" ) );
38+
config.setExcelTryAutoresize( true );
39+
YamlDocFacade facade = new YamlDocFacade();
40+
int result = facade.handle(reader, os, config);
41+
logger.info( "result -> {}", result );
42+
} catch (Exception e) {
43+
String message = "Error: "+e.getMessage();
44+
logger.error( message, e );
45+
fail( message );
46+
}
4147
}
4248
}
4349

4450
@Test
45-
public void testSample() {
46-
this.testWorkerSample( DocConfig.TYPE_XML );
47-
this.testWorkerSample( DocConfig.TYPE_FO );
48-
this.testWorkerSample( DocConfig.TYPE_PDF );
49-
this.testWorkerSample( DocConfig.TYPE_XLSX );
51+
public void testSampleEN() {
52+
this.testWorkerSample( LOCALE_EN, FILE_ENCODING, DocConfig.TYPE_XML, DocConfig.TYPE_FO, DocConfig.TYPE_PDF, DocConfig.TYPE_XLSX );
5053
}
5154

55+
@Test
56+
public void testSampleIT() {
57+
this.testWorkerSample( LOCALE_IT, FILE_ENCODING, DocConfig.TYPE_XML, DocConfig.TYPE_FO, DocConfig.TYPE_PDF, DocConfig.TYPE_XLSX );
58+
}
59+
60+
5261
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
doc.def.version=002.1
22
doc.def.title=My Test Openapi Documentation
33
doc.def.author=Fugerit
4-
doc.def.subject=My Test Subject
4+
doc.def.subject=My Test Subject
5+
6+
title.schema.list=Test list title

0 commit comments

Comments
 (0)