Skip to content

Commit 6101548

Browse files
committed
Merge branch 'FinderSystems-nancyfx-codegen'
2 parents f9cf78e + c2f5d83 commit 6101548

35 files changed

+3577
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ JavaJerseyServerCodegen.java
461461
JavaResteasyServerCodegen.java
462462
JavascriptClientCodegen.java
463463
NodeJSServerCodegen.java
464+
NancyFXServerCodegen
464465
ObjcClientCodegen.java
465466
PerlClientCodegen.java
466467
PhpClientCodegen.java
@@ -698,6 +699,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
698699
- [eureka](http://eure.jp/)
699700
- [everystory.us](http://everystory.us)
700701
- [Expected Behavior](http://www.expectedbehavior.com/)
702+
- [Finder](http://en.finder.pl/)
701703
- [FH Münster - University of Applied Sciences](http://www.fh-muenster.de)
702704
- [GraphHopper](https://graphhopper.com/)
703705
- [Gravitate Solutions](http://gravitatesolutions.com/)
@@ -767,6 +769,7 @@ Swaagger Codegen core team members are contributors who have been making signfic
767769
| Java Spring Boot | |
768770
| Java SpringMVC | @kolyjjj (2016/05/01) |
769771
| Java JAX-RS | |
772+
| NancyFX | |
770773
| NodeJS | @kolyjjj (2016/05/01) |
771774
| PHP Lumen | @abcsum (2016/05/01) |
772775
| PHP Silex | |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
2+
3+
If Not Exist %executable% (
4+
mvn clean package
5+
)
6+
7+
set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8+
set ags=generate -t modules\swagger-codegen\src\main\resources\nancyfx -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l nancyfx -o samples\server\petstore\nancyfx\
9+
10+
java %JAVA_OPTS% -jar %executable% %ags%

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Map;
66
import java.util.Set;
77
import java.util.TreeSet;
8+
import java.util.Objects;
89

910
import io.swagger.models.ExternalDocs;
1011

@@ -29,14 +30,15 @@ public class CodegenModel {
2930
public List<CodegenProperty> readOnlyVars = new ArrayList<CodegenProperty>(); // a list of read-only properties
3031
public List<CodegenProperty> readWriteVars = new ArrayList<CodegenProperty>(); // a list of properties for read, write
3132
public List<CodegenProperty> allVars;
33+
public List<CodegenProperty> parentVars = new ArrayList<>();
3234
public Map<String, Object> allowableValues;
3335

3436
// Sorted sets of required parameters.
3537
public Set<String> mandatory = new TreeSet<String>();
3638
public Set<String> allMandatory;
3739

3840
public Set<String> imports = new TreeSet<String>();
39-
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, isArrayModel;
41+
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, isArrayModel, hasChildren;
4042
public Boolean hasOnlyReadOnly = true; // true if all properties are read-only
4143
public ExternalDocs externalDocs;
4244

@@ -122,6 +124,12 @@ public boolean equals(Object o) {
122124
return false;
123125
if (externalDocs != null ? !externalDocs.equals(that.externalDocs) : that.externalDocs != null)
124126
return false;
127+
if (!Objects.equals(hasOnlyReadOnly, that.hasOnlyReadOnly))
128+
return false;
129+
if (!Objects.equals(hasChildren, that.hasChildren))
130+
return false;
131+
if (!Objects.equals(parentVars, that.parentVars))
132+
return false;
125133
return vendorExtensions != null ? vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions == null;
126134

127135
}
@@ -158,6 +166,9 @@ public int hashCode() {
158166
result = 31 * result + (isEnum != null ? isEnum.hashCode() : 0);
159167
result = 31 * result + (externalDocs != null ? externalDocs.hashCode() : 0);
160168
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
169+
result = 31 * result + Objects.hash(hasOnlyReadOnly);
170+
result = 31 * result + Objects.hash(hasChildren);
171+
result = 31 * result + Objects.hash(parentVars);
161172
return result;
162173
}
163174
}

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import java.util.List;
44
import java.util.Map;
5+
import java.util.Objects;
56

6-
public class CodegenProperty {
7+
public class CodegenProperty implements Cloneable {
78
public String baseName, complexType, getter, setter, description, datatype, datatypeWithEnum,
89
name, min, max, defaultValue, defaultValueWithParam, baseType, containerType;
910

@@ -43,6 +44,7 @@ public class CodegenProperty {
4344
public CodegenProperty items;
4445
public Map<String, Object> vendorExtensions;
4546
public Boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
47+
public Boolean isInherited;
4648

4749
@Override
4850
public String toString() {
@@ -105,6 +107,7 @@ public int hashCode()
105107
result = prime * result + ((isDateTime == null) ? 0 : isDateTime.hashCode());
106108
result = prime * result + ((isMapContainer == null) ? 0 : isMapContainer.hashCode());
107109
result = prime * result + ((isListContainer == null) ? 0 : isListContainer.hashCode());
110+
result = prime * result + Objects.hashCode(isInherited);
108111
return result;
109112
}
110113

@@ -256,6 +259,18 @@ public boolean equals(Object obj) {
256259
if (this.isMapContainer != other.isMapContainer && (this.isMapContainer == null || !this.isMapContainer.equals(other.isMapContainer))) {
257260
return false;
258261
}
262+
if (!Objects.equals(this.isInherited, other.isInherited)) {
263+
return false;
264+
}
259265
return true;
260266
}
267+
268+
@Override
269+
public CodegenProperty clone() {
270+
try {
271+
return (CodegenProperty) super.clone();
272+
} catch (CloneNotSupportedException e) {
273+
throw new IllegalStateException(e);
274+
}
275+
}
261276
}

0 commit comments

Comments
 (0)