Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/JavaCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ private static Service ParseService(AutoRestCodeModel codeModel, JavaSettings se
"protected","public", "return", "short", "static",
"strictfp", "super", "switch", "synchronized","this",
"throw", "throws", "transient","true", "try",
"void", "volatile", "while", "date", "datetime",
"period", "stream", "string", "object", "header"
"void", "volatile", "while"
});

if (!settings.IsAzureOrFluent)
Expand Down
20 changes: 10 additions & 10 deletions test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public final class Product {
private Integer integer;

/**
* The stringProperty property.
* The string property.
*/
@JsonProperty(value = "string")
private String stringProperty;
private String string;

/**
* Get the integer value.
Expand All @@ -49,22 +49,22 @@ public Product withInteger(Integer integer) {
}

/**
* Get the stringProperty value.
* Get the string value.
*
* @return the stringProperty value.
* @return the string value.
*/
public String stringProperty() {
return this.stringProperty;
public String string() {
return this.string;
}

/**
* Set the stringProperty value.
* Set the string value.
*
* @param stringProperty the stringProperty value to set.
* @param string the string value to set.
* @return the Product object itself.
*/
public Product withStringProperty(String stringProperty) {
this.stringProperty = stringProperty;
public Product withString(String string) {
this.string = string;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public final class Widget {
private Integer integer;

/**
* The stringProperty property.
* The string property.
*/
@JsonProperty(value = "string")
private String stringProperty;
private String string;

/**
* Get the integer value.
Expand All @@ -49,22 +49,22 @@ public Widget withInteger(Integer integer) {
}

/**
* Get the stringProperty value.
* Get the string value.
*
* @return the stringProperty value.
* @return the string value.
*/
public String stringProperty() {
return this.stringProperty;
public String string() {
return this.string;
}

/**
* Set the stringProperty value.
* Set the string value.
*
* @param stringProperty the stringProperty value to set.
* @param string the string value to set.
* @return the Widget object itself.
*/
public Widget withStringProperty(String stringProperty) {
this.stringProperty = stringProperty;
public Widget withString(String string) {
this.string = string;
return this;
}
}
10 changes: 5 additions & 5 deletions test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,31 +439,31 @@ public void getComplexItemNull() {
public void getComplexItemEmpty() {
List<Product> result = client.arrays().getComplexItemEmpty();
assertEquals(3, result.size());
assertNull(result.get(1).stringProperty());
assertNull(result.get(1).string());
}

@Test
public void getComplexValid() {
List<Product> result = client.arrays().getComplexValid();
assertEquals(3, result.size());
assertEquals(5, result.get(2).integer().intValue());
assertEquals("6", result.get(2).stringProperty());
assertEquals("6", result.get(2).string());
}

@Test
public void putComplexValid() {
List<Product> body = new ArrayList<>();
Product p1 = new Product();
p1.withInteger(1);
p1.withStringProperty("2");
p1.withString("2");
body.add(p1);
Product p2 = new Product();
p2.withInteger(3);
p2.withStringProperty("4");
p2.withString("4");
body.add(p2);
Product p3 = new Product();
p3.withInteger(5);
p3.withStringProperty("6");
p3.withString("6");
body.add(p3);
client.arrays().putComplexValid(body);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,31 +452,31 @@ public void getComplexItemEmpty() {
Map<String, Widget> result = client.dictionarys().getComplexItemEmpty();
assertEquals(3, result.size());
assertNull(result.get("1").integer());
assertNull(result.get("1").stringProperty());
assertNull(result.get("1").string());
}

@Test
public void getComplexValid() {
Map<String, Widget> result = client.dictionarys().getComplexValid();
assertEquals(3, result.size());
assertEquals(1, result.get("0").integer().intValue());
assertEquals("4", result.get("1").stringProperty());
assertEquals("4", result.get("1").string());
}

@Test
public void putComplexValid() {
Map<String, Widget> body = new HashMap<>();
Widget w1 = new Widget();
w1.withInteger(1);
w1.withStringProperty("2");
w1.withString("2");
body.put("0", w1);
Widget w2 = new Widget();
w2.withInteger(3);
w2.withStringProperty("4");
w2.withString("4");
body.put("1", w2);
Widget w3 = new Widget();
w3.withInteger(5);
w3.withStringProperty("6");
w3.withString("6");
body.put("2", w3);
client.dictionarys().putComplexValid(body);
}
Expand Down
20 changes: 10 additions & 10 deletions test/xml/src/main/java/fixtures/xml/models/Slideshow.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public final class Slideshow {
private String title;

/**
* The dateProperty property.
* The date property.
*/
@JacksonXmlProperty(localName = "date", isAttribute = true)
private String dateProperty;
private String date;

/**
* The author property.
Expand Down Expand Up @@ -66,22 +66,22 @@ public Slideshow withTitle(String title) {
}

/**
* Get the dateProperty value.
* Get the date value.
*
* @return the dateProperty value.
* @return the date value.
*/
public String dateProperty() {
return this.dateProperty;
public String date() {
return this.date;
}

/**
* Set the dateProperty value.
* Set the date value.
*
* @param dateProperty the dateProperty value to set.
* @param date the date value to set.
* @return the Slideshow object itself.
*/
public Slideshow withDateProperty(String dateProperty) {
this.dateProperty = dateProperty;
public Slideshow withDate(String date) {
this.date = date;
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions test/xml/src/test/java/fixtures/xml/XmlsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void getSimpleDocument() {
Slideshow slideshow = client.xmls().getSimple();
assertNotNull(slideshow);
assertEquals("Yours Truly", slideshow.author());
assertEquals("Date of publication", slideshow.dateProperty());
assertEquals("Date of publication", slideshow.date());
assertEquals("Sample Slide Show", slideshow.title());

assertNotNull(slideshow.slides());
Expand All @@ -56,7 +56,7 @@ public void getEmptyList() {
assertNotNull(slideshow.slides());
assertEquals(null, slideshow.title());
assertEquals(null, slideshow.author());
assertEquals(null, slideshow.dateProperty());
assertEquals(null, slideshow.date());
assertEquals(0, slideshow.slides().size());
}

Expand Down