Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -24,7 +24,8 @@ import java.util.Locale;
|
||||
public enum Language {
|
||||
EN(new Locale("en")),
|
||||
RU(new Locale("ru")),
|
||||
FR(new Locale("fr"));
|
||||
FR(new Locale("fr")),
|
||||
DE(new Locale("de"));
|
||||
|
||||
private final Locale lang;
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ public class Swagger2MarkupConverter {
|
||||
* @param outputDirectory the output directory path
|
||||
* @throws IOException if the files cannot be written
|
||||
*/
|
||||
public void intoFolder(Path outputDirectory) throws IOException {
|
||||
public void toFolder(Path outputDirectory) throws IOException {
|
||||
Validate.notNull(outputDirectory, "outputDirectory must not be null");
|
||||
|
||||
applySwaggerExtensions();
|
||||
@@ -173,9 +173,8 @@ public class Swagger2MarkupConverter {
|
||||
* Builds the document returns it as a String.
|
||||
*
|
||||
* @return the document as a String
|
||||
* @throws java.io.IOException if files can not be read
|
||||
*/
|
||||
public String asString() throws IOException {
|
||||
public String toString() {
|
||||
applySwaggerExtensions();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
definitions=Definitionen
|
||||
default_column=Standard
|
||||
example_column=Beispiel
|
||||
required_column=Pflichtfeld
|
||||
schema_column=Schema
|
||||
name_column=Name
|
||||
description_column=Beschreibung
|
||||
headers_column=Headers
|
||||
scopes_column=Scopes
|
||||
produces=Erzeugt
|
||||
consumes=Verarbeitet
|
||||
tags=Tags
|
||||
overview=Übersicht
|
||||
current_version=Aktuelle Version
|
||||
version=Version
|
||||
contact_information=Kontaktinformationen
|
||||
contact_name=Kontakt
|
||||
contact_email=Kontakt E-Mail
|
||||
license_information=Lizenzinformationen
|
||||
license=Linzenz
|
||||
license_url=Lizenz-URL
|
||||
terms_of_service=Nutzungsbedingungen
|
||||
uri_scheme=URI Schema
|
||||
host=Host
|
||||
base_path=Basis-Pfad
|
||||
schemes=Schemata
|
||||
security_name=
|
||||
security_type=Typ
|
||||
security_in=In
|
||||
security_flow=Flow
|
||||
security_authorizationUrl=Token URL
|
||||
security_tokenUrl=Token URL
|
||||
paths=Pfade
|
||||
resources=Ressourcen
|
||||
security=Sicherheit
|
||||
body_parameter=Body Parameter
|
||||
parameters=Parameter
|
||||
responses=Antworten
|
||||
response=Antwort
|
||||
request=Anfrage
|
||||
example_request=Beispiel HTTP Anfrage
|
||||
example_response=Beispiel HTTP Antwort
|
||||
type_column=Typ
|
||||
http_code_column=HTTP Code
|
||||
parameter=Parameter
|
||||
unknown=Unbekannt
|
||||
no_content=Kein Inhalt
|
||||
operation.deprecated=Diese Operation ist veraltet.
|
||||
@@ -55,7 +55,7 @@ public class AsciidocConverterTest {
|
||||
|
||||
//When
|
||||
String asciiDocAsString = Swagger2MarkupConverter.from(file).build()
|
||||
.asString();
|
||||
.toString();
|
||||
//Then
|
||||
assertThat(asciiDocAsString).isNotEmpty();
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class AsciidocConverterTest {
|
||||
.build();
|
||||
|
||||
Swagger2MarkupConverter.from(file).withConfig(config).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -95,7 +95,7 @@ public class AsciidocConverterTest {
|
||||
.build();
|
||||
|
||||
Swagger2MarkupConverter.from(swaggerJsonString).withConfig(config).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -119,7 +119,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(swaggerJsonString)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -143,7 +143,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(swaggerJsonString)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -166,7 +166,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -188,7 +188,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -212,7 +212,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
// If NullPointerException was not thrown, test would fail the specified message
|
||||
failBecauseExceptionWasNotThrown(NullPointerException.class);
|
||||
} catch (Exception e) {
|
||||
@@ -234,7 +234,7 @@ public class AsciidocConverterTest {
|
||||
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -250,7 +250,7 @@ public class AsciidocConverterTest {
|
||||
|
||||
//When
|
||||
Swagger2MarkupConverter.from(file).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -269,7 +269,7 @@ public class AsciidocConverterTest {
|
||||
|
||||
//When
|
||||
Swagger2MarkupConverter.from(file).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -292,7 +292,7 @@ public class AsciidocConverterTest {
|
||||
.withSeparatedDefinitions()
|
||||
.build();
|
||||
Swagger2MarkupConverter.from(file).withConfig(config).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -317,7 +317,7 @@ public class AsciidocConverterTest {
|
||||
.withSeparatedOperations()
|
||||
.build();
|
||||
Swagger2MarkupConverter.from(file).withConfig(config).build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -343,7 +343,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
assertThat(new String(Files.readAllBytes(outputDirectory.resolve("definitions.adoc")), Charset.forName("UTF-8")))
|
||||
@@ -364,7 +364,7 @@ public class AsciidocConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
assertThat(new String(Files.readAllBytes(outputDirectory.resolve("overview.adoc")), Charset.forName("UTF-8")))
|
||||
|
||||
@@ -71,7 +71,7 @@ public class MarkdownConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -96,7 +96,7 @@ public class MarkdownConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -118,7 +118,7 @@ public class MarkdownConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
//Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
@@ -146,7 +146,7 @@ public class MarkdownConverterTest {
|
||||
Swagger2MarkupConverter.from(file)
|
||||
.withConfig(config)
|
||||
.build()
|
||||
.intoFolder(outputDirectory);
|
||||
.toFolder(outputDirectory);
|
||||
|
||||
// Then
|
||||
String[] files = outputDirectory.toFile().list();
|
||||
|
||||
Reference in New Issue
Block a user