@Override
    Schema createDocumentSchema(
            Context<RestJson1Trait> context,
            Shape operationOrError,
            List<HttpBinding> bindings,
            MessageType message
    ) {
        if (bindings.isEmpty()) {
            return Schema.builder().type("object").build();
        }

        // We create a synthetic structure shape that is passed through the
        // JSON schema converter. This shape only contains members that make
        // up the "document" members of the input/output/error shape.
        ShapeId container = bindings.get(0).getMember().getContainer();
        StructureShape containerShape = context.getModel().expectShape(container, StructureShape.class);

        // Path parameters of requests are handled in "parameters" and headers are
        // handled in headers, so this method must ensure that only members that
        // are sent in the document payload are present in the structure when it is
        // converted to OpenAPI. This ensures that any path parameters are removed
        // before converting the structure to a synthesized JSON schema object.
        // Doing this sanitation after converting the shape to JSON schema might
        // result in things like "required" properties pointing to members that
        // don't exist.
        Set<String> documentMemberNames = bindings.stream()
                .map(HttpBinding::getMemberName)
                .collect(Collectors.toSet());

        // Remove non-document members.
        StructureShape.Builder containerShapeBuilder = containerShape.toBuilder();
        for (String memberName : containerShape.getAllMembers().keySet()) {
            if (!documentMemberNames.contains(memberName)) {
                containerShapeBuilder.removeMember(memberName);
            }
        }

        StructureShape cleanedShape = containerShapeBuilder.build();

        // If errors with the same status code have been deconflicted,
        // hoist the members from the synthetic target union and convert
        // the error structure to a union, so that a `oneOf` can be used
        // in the output without added nesting.
        if (context.getConfig().getOnErrorStatusConflict() != null
                && context.getConfig().getOnErrorStatusConflict().equals(ONE_OF)
                && targetsSyntheticError(cleanedShape, context)) {
            UnionShape targetUnion = context.getModel()
                    .expectShape(
                            cleanedShape.getAllMembers().values().stream().findFirst().get().getTarget(),
                            UnionShape.class);
            List<Schema> oneOfMembers = new ArrayList<>();
            for (MemberShape member : targetUnion.getAllMembers().values()) {
                oneOfMembers.add(context.createRef(member));
            }
            return Schema.builder().type(null).oneOf(oneOfMembers).build();
        }
        return context.getJsonSchemaConverter().convertShape(cleanedShape).getRootSchema();
    }
Converts the {@code aws.protocols#restJson1} protocol to OpenAPI.
smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1Protocol.java