diff --git a/docs/source/1.0/spec/core/http-traits.rst b/docs/source/1.0/spec/core/http-traits.rst index f1056d8921a..1fe41b7b6fb 100644 --- a/docs/source/1.0/spec/core/http-traits.rst +++ b/docs/source/1.0/spec/core/http-traits.rst @@ -766,10 +766,10 @@ Trait selector .. code-block:: none structure > member - :test(> simpleType:not(document), - > collection > member > simpleType:not(document))) + :test(> :test(string, number, boolean, timestamp), + > collection > member > :test(string, number, boolean, timestamp)) - *Structure members that target non-document simple types or collections of non-document simple types* + *Structure members that target string, number, boolean, or timestamp; or a list/set of said types* Value type ``string`` value defining the name of the query string parameter. The query string value MUST NOT be empty. This trait is ignored when @@ -791,7 +791,6 @@ Serialization rules: * Multiple members of a structure MUST NOT case-sensitively target the same query string parameter. * boolean values are serialized as ``true`` or ``false``. -* blob values are base64 encoded when serialized in the query string. * timestamp values are serialized as an :rfc:`3339` ``date-time`` string (e.g., ``1985-04-12T23:20:50.52Z``). The :ref:`timestampFormat-trait` MAY be used to use a custom serialization diff --git a/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy b/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy index 4fb7e093687..0472cdeb94c 100644 --- a/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy +++ b/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy @@ -537,8 +537,8 @@ structure httpLabel {} /// Binds an operation input structure member to a query string parameter. @trait(selector: """ structure > member - :test(> simpleType:not(document), - > collection > member > simpleType:not(document)))""", + :test(> :test(string, number, boolean, timestamp), + > collection > member > :test(string, number, boolean, timestamp))""", conflicts: [httpLabel, httpHeader, httpPrefixHeaders, httpPayload]) @length(min: 1) @tags(["diff.error.const"]) diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/QuerySchemaVisitor.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/QuerySchemaVisitor.java index be4b91c84d2..41cbc162469 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/QuerySchemaVisitor.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/QuerySchemaVisitor.java @@ -16,7 +16,6 @@ package software.amazon.smithy.openapi.fromsmithy.protocols; import software.amazon.smithy.jsonschema.Schema; -import software.amazon.smithy.model.shapes.BlobShape; import software.amazon.smithy.model.shapes.CollectionShape; import software.amazon.smithy.model.shapes.ListShape; import software.amazon.smithy.model.shapes.MemberShape; @@ -92,12 +91,4 @@ public Schema timestampShape(TimestampShape shape) { .format("date-time") .build(); } - - // Query string blobs in Smithy must be base64 encoded, so this - // code grabs the referenced shape and creates an inline schema that - // explicitly defines the necessary styles. - @Override - public Schema blobShape(BlobShape shape) { - return schema.toBuilder().ref(null).type("string").format("byte").build(); - } } diff --git a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java index d5aecb3ea40..9234dff56e6 100644 --- a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java +++ b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java @@ -23,7 +23,6 @@ public class AwsRestJson1ProtocolTest { "adds-json-document-bodies.json", "adds-path-timestamp-format.json", "adds-query-timestamp-format.json", - "adds-query-blob-format.json", "adds-header-timestamp-format.json", "adds-header-mediatype-format.json", "supports-payloads.json", diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/adds-query-blob-format.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/adds-query-blob-format.json deleted file mode 100644 index 9b300261228..00000000000 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/adds-query-blob-format.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "smithy": "1.0", - "shapes": { - "smithy.example#Service": { - "type": "service", - "version": "2006-03-01", - "operations": [ - { - "target": "smithy.example#Operation" - } - ], - "traits": { - "aws.protocols#restJson1": {} - } - }, - "smithy.example#Operation": { - "type": "operation", - "input": { - "target": "smithy.example#OperationInput" - }, - "traits": { - "smithy.api#http": { - "uri": "/", - "method": "POST" - } - } - }, - "smithy.example#OperationInput": { - "type": "structure", - "members": { - "blob1": { - "target": "smithy.api#Blob", - "traits": { - "smithy.api#httpQuery": "blob1" - } - }, - "blobList": { - "target": "smithy.example#BlobList", - "traits": { - "smithy.api#httpQuery": "blob2" - } - } - } - }, - "smithy.example#BlobList": { - "type": "list", - "member": { - "target": "smithy.api#Blob" - } - } - } -} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/adds-query-blob-format.openapi.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/adds-query-blob-format.openapi.json deleted file mode 100644 index 3ee290536e2..00000000000 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/protocols/adds-query-blob-format.openapi.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "openapi": "3.0.2", - "info": { - "title": "Service", - "version": "2006-03-01" - }, - "paths": { - "/": { - "post": { - "operationId": "Operation", - "parameters": [ - { - "name": "blob1", - "in": "query", - "schema": { - "type": "string", - "format": "byte" - } - }, - { - "name": "blob2", - "in": "query", - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } - }, - "explode": true - } - ], - "responses": { - "200": { - "description": "Operation response" - } - } - } - } - } -}