diff --git a/aws/smithy-aws-apigateway-openapi/src/test/resources/software/amazon/smithy/aws/apigateway/openapi/cors-model.openapi.json b/aws/smithy-aws-apigateway-openapi/src/test/resources/software/amazon/smithy/aws/apigateway/openapi/cors-model.openapi.json index 644dbadb4df..7b04f290464 100644 --- a/aws/smithy-aws-apigateway-openapi/src/test/resources/software/amazon/smithy/aws/apigateway/openapi/cors-model.openapi.json +++ b/aws/smithy-aws-apigateway-openapi/src/test/resources/software/amazon/smithy/aws/apigateway/openapi/cors-model.openapi.json @@ -365,8 +365,7 @@ "type": "object", "properties": { "createdAt": { - "type": "string", - "format": "date-time" + "type": "number" }, "id": { "type": "string" diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJsonProtocol.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJsonProtocol.java index 5914c93af58..66c63c5e443 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJsonProtocol.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJsonProtocol.java @@ -26,6 +26,7 @@ import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.ShapeIndex; import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.TimestampFormatTrait; import software.amazon.smithy.openapi.OpenApiConstants; import software.amazon.smithy.openapi.fromsmithy.Context; import software.amazon.smithy.utils.SetUtils; @@ -42,7 +43,9 @@ public Set getProtocolNames() { @Override public ObjectNode getDefaultSettings() { - return Node.objectNode().withMember(JsonSchemaConstants.SMITHY_USE_JSON_NAME, true); + return Node.objectNode() + .withMember(JsonSchemaConstants.SMITHY_USE_JSON_NAME, true) + .withMember(JsonSchemaConstants.SMITHY_DEFAULT_TIMESTAMP_FORMAT, TimestampFormatTrait.EPOCH_SECONDS); } @Override diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.json index 06f8220227c..3d8ab468e92 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.json +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.json @@ -72,8 +72,7 @@ "type": "string" }, "time": { - "type": "string", - "format": "date-time" + "type": "number" }, "list": { "type": "array", diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.not-inlined.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.not-inlined.json index 64fdfa6a005..ace51745c06 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.not-inlined.json +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/test-service.openapi.not-inlined.json @@ -245,8 +245,7 @@ "type": "string" }, "ExampleRestCreateDocumentOutputTimeMember": { - "type": "string", - "format": "date-time" + "type": "number" }, "ExampleRestPutPayloadInputQueryMember": { "type": "number",