-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing couple of issues in union type serialization/deserialization.
- Loading branch information
1 parent
6c43f02
commit dabf8ce
Showing
10 changed files
with
216 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
org.aml.raml2java/src/test/java/org/aml/raml2java/ParameterizedType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.aml.raml2java; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
public class ParameterizedType implements java.lang.reflect.ParameterizedType{ | ||
|
||
final Class<?>raw; | ||
final Type[] arg; | ||
public ParameterizedType(Class<?> raw, Class<?> arg) { | ||
super(); | ||
this.raw = raw; | ||
this.arg = new Type[]{arg}; | ||
} | ||
|
||
|
||
|
||
@Override | ||
public Type[] getActualTypeArguments() { | ||
return arg; | ||
} | ||
|
||
@Override | ||
public Type getRawType() { | ||
return raw; | ||
} | ||
|
||
@Override | ||
public Type getOwnerType() { | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{ | ||
"dateAndTime": "222", | ||
"value": 2, | ||
"machineId": "2323", | ||
"productId": "dede" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"saleDetails":[{ | ||
"dateAndTime": "222", | ||
"value": 2, | ||
"machineId": "2323", | ||
"productId": "dede" | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#%RAML 1.0 | ||
title: A | ||
types: | ||
Exchange: | ||
type: object | ||
properties: | ||
value: integer | ||
in: integer | ||
out: integer | ||
Sale: | ||
type: object | ||
properties: | ||
machineId: string | ||
trayId: string | ||
dateAndTime: datetime-only | ||
exchange: Exchange | ||
SaleDetail: | ||
type: object | ||
properties: | ||
dateAndTime: datetime-only | ||
value: integer | ||
machineId: string | ||
productId: string | ||
SaleDetails: | ||
type: array | ||
items: SaleDetail | ||
SalesSummary: | ||
type: object | ||
properties: | ||
count: integer | ||
totalValue: integer | ||
sales: SaleDetails | ||
H: SalesSummary | SaleDetails |