diff --git a/settings.gradle b/settings.gradle index 33054bd8e..fc3a41965 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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' diff --git a/verification-client-api/build.gradle b/verification-client-api/build.gradle new file mode 100644 index 000000000..9ab6c66ee --- /dev/null +++ b/verification-client-api/build.gradle @@ -0,0 +1,2 @@ +apply plugin: 'com.palantir.conjure' + diff --git a/verification-client-api/src/main/conjure/auto-deserialize-service.yml b/verification-client-api/src/main/conjure/auto-deserialize-service.yml new file mode 100644 index 000000000..b635f4114 --- /dev/null +++ b/verification-client-api/src/main/conjure/auto-deserialize-service.yml @@ -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 } diff --git a/verification-client-api/src/main/conjure/example-types.conjure.yml b/verification-client-api/src/main/conjure/example-types.conjure.yml new file mode 100644 index 000000000..f5231d8de --- /dev/null +++ b/verification-client-api/src/main/conjure/example-types.conjure.yml @@ -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 + + SetStringExample: + fields: + value: set + + SetDoubleExample: + fields: + value: set + + MapExample: + fields: + value: map + # AnyMapExample: + # fields: + # items: map + # AliasAsMapKeyExample: + # fields: + # strings: map + # rids: map + # bearertokens: map + # integers: map + # # doubles: map # typescript freaks out with the 'NaN' + # safelongs: map + # datetimes: map + # uuids: map + + OptionalExample: { fields: { value: optional } } + LongOptionalExample: { fields: { someLongName: optional } } + + RawOptionalExample: { alias: optional } + + # PrimitiveOptionalsExample: + # fields: + # num: optional + # bool: optional + # integer: optional + # safelong: optional + # rid: optional + # bearertoken: optional + # uuid: optional + + # 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 + items: list + set: set + map: map + 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 + thisFieldIsAnInteger: integer + alsoAnInteger: integer + if: integer # some 'bad' member names! + new: integer + interface: integer diff --git a/verification-client-api/src/main/conjure/verification-client.conjure.yml b/verification-client-api/src/main/conjure/verification-client.conjure.yml new file mode 100644 index 000000000..d47b66ca3 --- /dev/null +++ b/verification-client-api/src/main/conjure/verification-client.conjure.yml @@ -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 diff --git a/verification-client-api/verification-client-api-objects/.gitignore b/verification-client-api/verification-client-api-objects/.gitignore new file mode 100644 index 000000000..042dfd9b4 --- /dev/null +++ b/verification-client-api/verification-client-api-objects/.gitignore @@ -0,0 +1 @@ +/src/generated/java/