Skip to content

Commit

Permalink
Fix httpQuery selector
Browse files Browse the repository at this point in the history
httpQuery does not actually support blobs, and no AWS service has ever
put a blob in a query string. Blobs can be added back to Smithy if/when
there's actual support for it.
  • Loading branch information
mtdowling committed Aug 20, 2020
1 parent 95f526e commit 31c23b2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 110 deletions.
7 changes: 3 additions & 4 deletions docs/source/1.0/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,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
Expand All @@ -789,7 +789,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 31c23b2

Please sign in to comment.