diff --git a/ndc-http-schema/openapi/internal/oas3_schema.go b/ndc-http-schema/openapi/internal/oas3_schema.go index 2e393ed..64f7fcf 100644 --- a/ndc-http-schema/openapi/internal/oas3_schema.go +++ b/ndc-http-schema/openapi/internal/oas3_schema.go @@ -324,7 +324,7 @@ func (oc *oas3SchemaBuilder) buildUnionSchemaType(baseSchema *base.Schema, schem }, nil } - if len(oasTypes) == 1 && baseSchema.Type[0] == "object" { + if len(oasTypes) == 1 && (baseSchema.Type[0] == "object" || (baseSchema.Properties != nil && baseSchema.Properties.Len() > 0)) { schemaResult, err := oc.evalObjectType(baseSchema, fieldPaths) if err != nil { return nil, err diff --git a/ndc-http-schema/openapi/internal/oas_utils.go b/ndc-http-schema/openapi/internal/oas_utils.go index b3870d6..e7272ad 100644 --- a/ndc-http-schema/openapi/internal/oas_utils.go +++ b/ndc-http-schema/openapi/internal/oas_utils.go @@ -311,7 +311,9 @@ func evalSchemaProxiesSlice(schemaProxies []*base.SchemaProxy, location rest.Par continue } sc := proxy.Schema() - if sc == nil || (len(sc.Type) == 0 && len(sc.AllOf) == 0 && len(sc.AnyOf) == 0 && len(sc.OneOf) == 0) { + if sc == nil || (len(sc.Type) == 0 && len(sc.AllOf) == 0 && len(sc.AnyOf) == 0 && len(sc.OneOf) == 0 && + (sc.Properties == nil || sc.Properties.Len() == 0) && + (sc.Items == nil || sc.Items.A != nil)) { continue } @@ -332,13 +334,10 @@ func evalSchemaProxiesSlice(schemaProxies []*base.SchemaProxy, location rest.Par } results = append(results, proxy) - if len(sc.Type) == 0 { - typeNames = append(typeNames, "any") - } else if !slices.Contains(typeNames, sc.Type[0]) { - typeNames = append(typeNames, sc.Type[0]) - } + typeNames = append(typeNames, sc.Type...) } + typeNames = utils.SliceUnique(typeNames) if len(typeNames) == 1 && len(results) > 1 && typeNames[0] == "string" { // if the anyOf array contains both string and enum // we can cast them to string diff --git a/ndc-http-schema/openapi/testdata/onesignal/expected.json b/ndc-http-schema/openapi/testdata/onesignal/expected.json index 17a0b0b..4842bef 100644 --- a/ndc-http-schema/openapi/testdata/onesignal/expected.json +++ b/ndc-http-schema/openapi/testdata/onesignal/expected.json @@ -1225,7 +1225,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "DeliveryData", + "name": "PlatformDeliveryDataEmail", "type": "named" } }, @@ -1281,7 +1281,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "DeliveryData", + "name": "PlatformDeliveryDataSms", "type": "named" } }, @@ -1293,6 +1293,314 @@ } } }, + "PlatformDeliveryDataEmail": { + "fields": { + "bounced": { + "description": "Number of recipients who registered as a hard or soft bounce and didn't receive your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "clicks": { + "description": "Number of clicked links from your email. This can include the recipient clicking email links multiple times.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "opened": { + "description": "Number of times an email has been opened.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "reported_spam": { + "description": "Number of recipients who reported this email as spam.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unique_clicks": { + "description": "Number of unique clicks that your recipients have made on links from your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unique_opens": { + "description": "Number of unique recipients who have opened your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unsubscribed": { + "description": "Number of recipients who opted out of your emails using the unsubscribe link in this email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + } + } + }, + "PlatformDeliveryDataSms": { + "fields": { + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_errored": { + "description": "Number of errors reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_failed": { + "description": "Number of recipients who didn't receive your message as reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_successful": { + "description": "Number of messages reported as delivered successfully by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + } + } + }, "StringMap": { "fields": { "en": { diff --git a/ndc-http-schema/openapi/testdata/onesignal/schema.json b/ndc-http-schema/openapi/testdata/onesignal/schema.json index f5332f4..16889d2 100644 --- a/ndc-http-schema/openapi/testdata/onesignal/schema.json +++ b/ndc-http-schema/openapi/testdata/onesignal/schema.json @@ -748,7 +748,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "DeliveryData", + "name": "PlatformDeliveryDataEmail", "type": "named" } } @@ -784,7 +784,215 @@ "type": { "type": "nullable", "underlying_type": { - "name": "DeliveryData", + "name": "PlatformDeliveryDataSms", + "type": "named" + } + } + } + } + }, + "PlatformDeliveryDataEmail": { + "fields": { + "bounced": { + "description": "Number of recipients who registered as a hard or soft bounce and didn't receive your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "clicks": { + "description": "Number of clicked links from your email. This can include the recipient clicking email links multiple times.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "opened": { + "description": "Number of times an email has been opened.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "reported_spam": { + "description": "Number of recipients who reported this email as spam.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unique_clicks": { + "description": "Number of unique clicks that your recipients have made on links from your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unique_opens": { + "description": "Number of unique recipients who have opened your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unsubscribed": { + "description": "Number of recipients who opted out of your emails using the unsubscribe link in this email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + } + } + }, + "PlatformDeliveryDataSms": { + "fields": { + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_errored": { + "description": "Number of errors reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_failed": { + "description": "Number of recipients who didn't receive your message as reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_successful": { + "description": "Number of messages reported as delivered successfully by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", "type": "named" } } diff --git a/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.json b/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.json index 708a099..96f4c60 100644 --- a/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.json +++ b/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.json @@ -1102,7 +1102,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraOneSignalDeliveryData", + "name": "HasuraOneSignalPlatformDeliveryDataEmail", "type": "named" } }, @@ -1158,7 +1158,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraOneSignalDeliveryData", + "name": "HasuraOneSignalPlatformDeliveryDataSms", "type": "named" } }, @@ -1170,6 +1170,314 @@ } } }, + "HasuraOneSignalPlatformDeliveryDataEmail": { + "fields": { + "bounced": { + "description": "Number of recipients who registered as a hard or soft bounce and didn't receive your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "clicks": { + "description": "Number of clicked links from your email. This can include the recipient clicking email links multiple times.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "opened": { + "description": "Number of times an email has been opened.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "reported_spam": { + "description": "Number of recipients who reported this email as spam.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unique_clicks": { + "description": "Number of unique clicks that your recipients have made on links from your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unique_opens": { + "description": "Number of unique recipients who have opened your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unsubscribed": { + "description": "Number of recipients who opted out of your emails using the unsubscribe link in this email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + } + } + }, + "HasuraOneSignalPlatformDeliveryDataSms": { + "fields": { + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_errored": { + "description": "Number of errors reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_failed": { + "description": "Number of recipients who didn't receive your message as reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_successful": { + "description": "Number of messages reported as delivered successfully by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + } + } + }, "HasuraOneSignalStringMap": { "fields": { "en": { diff --git a/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.schema.json b/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.schema.json index d67e496..26d3423 100644 --- a/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.schema.json +++ b/ndc-http-schema/openapi/testdata/prefix3/expected_multi_words.schema.json @@ -669,7 +669,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraOneSignalDeliveryData", + "name": "HasuraOneSignalPlatformDeliveryDataEmail", "type": "named" } } @@ -705,7 +705,215 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraOneSignalDeliveryData", + "name": "HasuraOneSignalPlatformDeliveryDataSms", + "type": "named" + } + } + } + } + }, + "HasuraOneSignalPlatformDeliveryDataEmail": { + "fields": { + "bounced": { + "description": "Number of recipients who registered as a hard or soft bounce and didn't receive your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "clicks": { + "description": "Number of clicked links from your email. This can include the recipient clicking email links multiple times.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "opened": { + "description": "Number of times an email has been opened.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "reported_spam": { + "description": "Number of recipients who reported this email as spam.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unique_clicks": { + "description": "Number of unique clicks that your recipients have made on links from your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unique_opens": { + "description": "Number of unique recipients who have opened your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unsubscribed": { + "description": "Number of recipients who opted out of your emails using the unsubscribe link in this email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + } + } + }, + "HasuraOneSignalPlatformDeliveryDataSms": { + "fields": { + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_errored": { + "description": "Number of errors reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_failed": { + "description": "Number of recipients who didn't receive your message as reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_successful": { + "description": "Number of messages reported as delivered successfully by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", "type": "named" } } diff --git a/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.json b/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.json index 7131134..79e909d 100644 --- a/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.json +++ b/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.json @@ -1102,7 +1102,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraDeliveryData", + "name": "HasuraPlatformDeliveryDataEmail", "type": "named" } }, @@ -1158,7 +1158,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraDeliveryData", + "name": "HasuraPlatformDeliveryDataSms", "type": "named" } }, @@ -1170,6 +1170,314 @@ } } }, + "HasuraPlatformDeliveryDataEmail": { + "fields": { + "bounced": { + "description": "Number of recipients who registered as a hard or soft bounce and didn't receive your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "clicks": { + "description": "Number of clicked links from your email. This can include the recipient clicking email links multiple times.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "opened": { + "description": "Number of times an email has been opened.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "reported_spam": { + "description": "Number of recipients who reported this email as spam.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unique_clicks": { + "description": "Number of unique clicks that your recipients have made on links from your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unique_opens": { + "description": "Number of unique recipients who have opened your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "unsubscribed": { + "description": "Number of recipients who opted out of your emails using the unsubscribe link in this email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + } + } + }, + "HasuraPlatformDeliveryDataSms": { + "fields": { + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_errored": { + "description": "Number of errors reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_failed": { + "description": "Number of recipients who didn't receive your message as reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "provider_successful": { + "description": "Number of messages reported as delivered successfully by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + }, + "http": { + "type": [ + "integer" + ] + } + } + } + }, "HasuraStringMap": { "fields": { "en": { diff --git a/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.schema.json b/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.schema.json index 218d9c9..5b064bb 100644 --- a/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.schema.json +++ b/ndc-http-schema/openapi/testdata/prefix3/expected_single_word.schema.json @@ -669,7 +669,7 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraDeliveryData", + "name": "HasuraPlatformDeliveryDataEmail", "type": "named" } } @@ -705,7 +705,215 @@ "type": { "type": "nullable", "underlying_type": { - "name": "HasuraDeliveryData", + "name": "HasuraPlatformDeliveryDataSms", + "type": "named" + } + } + } + } + }, + "HasuraPlatformDeliveryDataEmail": { + "fields": { + "bounced": { + "description": "Number of recipients who registered as a hard or soft bounce and didn't receive your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "clicks": { + "description": "Number of clicked links from your email. This can include the recipient clicking email links multiple times.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "opened": { + "description": "Number of times an email has been opened.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "reported_spam": { + "description": "Number of recipients who reported this email as spam.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unique_clicks": { + "description": "Number of unique clicks that your recipients have made on links from your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unique_opens": { + "description": "Number of unique recipients who have opened your email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "unsubscribed": { + "description": "Number of recipients who opted out of your emails using the unsubscribe link in this email.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + } + } + }, + "HasuraPlatformDeliveryDataSms": { + "fields": { + "converted": { + "description": "Number of messages that were clicked.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "errored": { + "description": "Number of errors reported.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "failed": { + "description": "Number of messages sent to unsubscribed devices.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_errored": { + "description": "Number of errors reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_failed": { + "description": "Number of recipients who didn't receive your message as reported by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "provider_successful": { + "description": "Number of messages reported as delivered successfully by the SMS service provider.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "received": { + "description": "Number of devices that received the message.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", + "type": "named" + } + } + }, + "successful": { + "description": "Number of messages delivered to push servers, mobile carriers, or email service providers.", + "type": { + "type": "nullable", + "underlying_type": { + "name": "Int32", "type": "named" } }