Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial verification client API #51

Merged
merged 3 commits into from
Oct 24, 2018
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
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ rootProject.name = 'conjure-verification'

include 'verification-server-api'
include 'verification-server-api:verification-server-api-objects'
include 'verification-client-api'
include 'verification-client-api:verification-client-api-objects'
2 changes: 2 additions & 0 deletions verification-client-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apply plugin: 'com.palantir.conjure'

169 changes: 169 additions & 0 deletions verification-client-api/src/main/conjure/auto-deserialize-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
types:
conjure-imports:
examples: example-types.conjure.yml

services:
AutoDeserialiseTestService:
name: Test Service
package: com.palantir.conjure.verification.client
default-auth: none
endpoints:
# primitives
getBearerTokenExample:
http: POST /receiveBearerTokenExample
returns: examples.BearerTokenExample
args: { body: examples.BearerTokenExample }

# TODO(dfox): define a test-case for this
# getBinaryExample:
# http: POST /receiveBinaryExample
# returns: examples.BinaryExample
# args: { body: examples.BinaryExample }

getBooleanExample:
http: POST /receiveBooleanExample
returns: examples.BooleanExample
args: { body: examples.BooleanExample }

getDateTimeExample:
http: POST /receiveDateTimeExample
returns: examples.DateTimeExample
args: { body: examples.DateTimeExample }

getDoubleExample:
http: POST /receiveDoubleExample
returns: examples.DoubleExample
args: { body: examples.DoubleExample }

getIntegerExample:
http: POST /receiveIntegerExample
returns: examples.IntegerExample
args: { body: examples.IntegerExample }

getRidExample:
http: POST /receiveRidExample
returns: examples.RidExample
args: { body: examples.RidExample }

getSafeLongExample:
http: POST /receiveSafeLongExample
returns: examples.SafeLongExample
args: { body: examples.SafeLongExample }

getStringExample:
http: POST /receiveStringExample
returns: examples.StringExample
args: { body: examples.StringExample }

getUuidExample:
http: POST /receiveUuidExample
returns: examples.UuidExample
args: { body: examples.UuidExample }

getAnyExample:
http: POST /receiveAnyExample
returns: examples.AnyExample
args: { body: examples.AnyExample }

# collections
getListExample:
http: POST /receiveListExample
returns: examples.ListExample
args: { body: examples.ListExample }

getSetStringExample:
http: POST /receiveSetStringExample
returns: examples.SetStringExample
args: { body: examples.SetStringExample }

getSetDoubleExample:
http: POST /receiveSetDoubleExample
returns: examples.SetDoubleExample
args: { body: examples.SetDoubleExample }

getMapExample:
http: POST /receiveMapExample
returns: examples.MapExample
args: { body: examples.MapExample }

getOptionalExample:
http: POST /receiveOptionalExample
returns: examples.OptionalExample
args: { body: examples.OptionalExample }

getLongOptionalExample:
http: POST /receiveLongOptionalExample
returns: examples.LongOptionalExample
args: { body: examples.LongOptionalExample }

getRawOptionalExample:
http: POST /receiveRawOptionalExample
returns: examples.RawOptionalExample
args: { body: examples.RawOptionalExample }

# complex alias
getStringAliasExample:
http: POST /receiveStringAliasExample
returns: examples.StringAliasExample
args: { body: examples.StringAliasExample }

getDoubleAliasExample:
http: POST /receiveDoubleAliasExample
returns: examples.DoubleAliasExample
args: { body: examples.DoubleAliasExample }

getIntegerAliasExample:
http: POST /receiveIntegerAliasExample
returns: examples.IntegerAliasExample
args: { body: examples.IntegerAliasExample }

getBooleanAliasExample:
http: POST /receiveBooleanAliasExample
returns: examples.BooleanAliasExample
args: { body: examples.BooleanAliasExample }

getSafeLongAliasExample:
http: POST /receiveSafeLongAliasExample
returns: examples.SafeLongAliasExample
args: { body: examples.SafeLongAliasExample }

getRidAliasExample:
http: POST /receiveRidAliasExample
returns: examples.RidAliasExample
args: { body: examples.RidAliasExample }

getBearerTokenAliasExample:
http: POST /receiveBearerTokenAliasExample
returns: examples.BearerTokenAliasExample
args: { body: examples.BearerTokenAliasExample }

getUuidAliasExample:
http: POST /receiveUuidAliasExample
returns: examples.UuidAliasExample
args: { body: examples.UuidAliasExample }

getReferenceAliasExample:
http: POST /receiveReferenceAliasExample
returns: examples.ReferenceAliasExample
args: { body: examples.ReferenceAliasExample }

getDateTimeAliasExample:
http: POST /receiveDateTimeAliasExample
returns: examples.DateTimeAliasExample
args: { body: examples.DateTimeAliasExample }

# TODO(dfox): define a test case for this
# getBinaryAliasExample:
# http: POST /receiveBinaryAliasExample
# returns: examples.BinaryAliasExample
# args: { body: examples.BinaryAliasExample }

getKebabCaseObjectExample:
http: POST /receiveKebabCaseObjectExample
returns: examples.KebabCaseObjectExample
args: { body: examples.KebabCaseObjectExample }

getSnakeCaseObjectExample:
http: POST /receiveSnakeCaseObjectExample
returns: examples.SnakeCaseObjectExample
args: { body: examples.SnakeCaseObjectExample }
123 changes: 123 additions & 0 deletions verification-client-api/src/main/conjure/example-types.conjure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
types:
definitions:
default-package: com.palantir.conjure.verification.client
objects:

# primitives: https://github.com/palantir/conjure/blob/develop/specification.md#primitiveDataTypes
BearerTokenExample: { fields: { value: bearertoken } }
BinaryExample: { fields: { value: binary } }
BooleanExample: { fields: { value: boolean } }
DateTimeExample: { fields: { value: datetime } }
DoubleExample: { fields: { value: double } }
IntegerExample: { fields: { value: integer } }
RidExample: { fields: { value: rid } }
SafeLongExample: { fields: { value: safelong } }
StringExample: { fields: { value: string } }
UuidExample: { fields: { value: uuid } }
AnyExample: { fields: { value: any } }

# collections: https://github.com/palantir/conjure/blob/develop/specification.md#collection-data-types
ListExample:
fields:
value: list<string>

SetStringExample:
fields:
value: set<string>

SetDoubleExample:
fields:
value: set<double>

MapExample:
fields:
value: map<string, string>
# AnyMapExample:
# fields:
# items: map<string, any>
# AliasAsMapKeyExample:
# fields:
# strings: map<StringAliasExample, ManyFieldExample>
# rids: map<RidAliasExample, ManyFieldExample>
# bearertokens: map<BearerTokenAliasExample, ManyFieldExample>
# integers: map<IntegerAliasExample, ManyFieldExample>
# # doubles: map<DoubleAliasExample, ManyFieldExample> # typescript freaks out with the 'NaN'
# safelongs: map<SafeLongAliasExample, ManyFieldExample>
# datetimes: map<DateTimeAliasExample, ManyFieldExample>
# uuids: map<UuidAliasExample, ManyFieldExample>

OptionalExample: { fields: { value: optional<string> } }
LongOptionalExample: { fields: { someLongName: optional<string> } }

RawOptionalExample: { alias: optional<integer> }

# PrimitiveOptionalsExample:
# fields:
# num: optional<double>
# bool: optional<boolean>
# integer: optional<integer>
# safelong: optional<safelong>
# rid: optional<rid>
# bearertoken: optional<bearertoken>
# uuid: optional<uuid>

# complex: https://github.com/palantir/conjure/blob/develop/specification.md#complex-data-types

# complex alias
AliasString: { alias: string }
StringAliasExample: { alias: string }
DoubleAliasExample: { alias: double }
IntegerAliasExample: { alias: integer }
BooleanAliasExample: { alias: boolean }
SafeLongAliasExample: { alias: safelong }
RidAliasExample: { alias: rid }
BearerTokenAliasExample: { alias: bearertoken }
UuidAliasExample: { alias: uuid }
ReferenceAliasExample: { alias: AnyExample }
DateTimeAliasExample: { alias: datetime }
BinaryAliasExample: { alias: binary }

# complex enum
EnumExample:
values:
- ONE
- TWO
Enum:
values:
- ONE
- TWO
EnumFieldExample: { fields: { enum: EnumExample } }

# complex object
EmptyObjectExample:
fields: {}
ObjectExample:
fields:
string: string
integer: integer
doubleValue: double
optionalItem: optional<string>
items: list<string>
set: set<string>
map: map<string, string>
alias: StringAliasExample

KebabCaseObjectExample:
fields:
kebab-cased-field: integer

SnakeCaseObjectExample:
fields:
snake_cased_field: integer

# complex union
Union:
docs: A type which can either be a StringExample, a set of strings, or an integer.
union:
stringExample: StringExample
set: set<string>
thisFieldIsAnInteger: integer
alsoAnInteger: integer
if: integer # some 'bad' member names!
new: integer
interface: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
types:
definitions:
default-package: com.palantir.conjure.verification.client
objects:
VerificationClientRequest:
fields:
endpointName: EndpointName
testCase: integer
baseUrl: string

EndpointName:
alias: string

services:
VerificationClientService:
name: Verification Client Service
package: com.palantir.conjure.verification.client
default-auth: none
endpoints:
runTestCase:
http: POST /runTestCase
args:
body: VerificationClientRequest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src/generated/java/