diff --git a/docs/source-2.0/guides/converting-to-openapi.rst b/docs/source-2.0/guides/converting-to-openapi.rst index 842cdb4e1be..8097c4d5423 100644 --- a/docs/source-2.0/guides/converting-to-openapi.rst +++ b/docs/source-2.0/guides/converting-to-openapi.rst @@ -1841,4 +1841,4 @@ The conversion process is highly extensible through .. _x-amazon-apigateway-authorizer: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html .. _Lambda authorizers: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-authorizer.html .. _API Gateway's API key usage plans: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html -.. _OpenAPI specification extension: https://spec.openapis.org/oas/v3.1.0#specification-extensions \ No newline at end of file +.. _OpenAPI specification extension: https://spec.openapis.org/oas/v3.1.0#specification-extensions diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapper.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapper.java index fbcd186b68e..a1ff07bcd8c 100644 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapper.java +++ b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapper.java @@ -19,6 +19,11 @@ /** * Updates a schema builder before converting a shape to a schema. + * + * {@link JsonSchemaMapper#updateSchema(JsonSchemaMapperContext, Schema.Builder)} is the entry point during JSON Schema + * conversion, and is the recommended method to implement. If this method is implemented, + * {@link JsonSchemaMapper#updateSchema(Shape, Schema.Builder, JsonSchemaConfig)} will NOT be called unless written in + * the implementation. */ public interface JsonSchemaMapper { /** @@ -36,12 +41,33 @@ default byte getOrder() { } /** - * Updates a schema builder. + * Updates a schema builder using information in {@link JsonSchemaMapperContext}. + * + * If not implemented, will default to + * {@link JsonSchemaMapper#updateSchema(Shape, Schema.Builder, JsonSchemaConfig)} for backwards-compatibility. + * + * @param context Context with information needed to update the schema. + * @param schemaBuilder Schema builder to update. + * @return Returns an updated schema builder. + */ + default Schema.Builder updateSchema(JsonSchemaMapperContext context, Schema.Builder schemaBuilder) { + return updateSchema(context.getShape(), schemaBuilder, context.getConfig()); + } + + /** + * Updates a schema builder, and is not recommended. Use + * {@link JsonSchemaMapper#updateSchema(JsonSchemaMapperContext, Schema.Builder)} instead. + * + * If not implemented, this method will default to a no-op. + * + * This method is not deprecated for backwards-compatibility. * * @param shape Shape used for the conversion. * @param schemaBuilder Schema builder to update. * @param config JSON Schema config. * @return Returns an updated schema builder. */ - Schema.Builder updateSchema(Shape shape, Schema.Builder schemaBuilder, JsonSchemaConfig config); + default Schema.Builder updateSchema(Shape shape, Schema.Builder schemaBuilder, JsonSchemaConfig config) { + return schemaBuilder; + } } diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java index 628e502a66b..49f47e4ef31 100644 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java +++ b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.jsonschema; import software.amazon.smithy.model.Model; @@ -11,17 +10,15 @@ /** * Context for a JSON schema mapping. - * - * @param Type of Smithy {@link Shape} being mapped. */ -public class JsonSchemaMapperContext { +public class JsonSchemaMapperContext { private final Model model; - private final T shape; + private final Shape shape; private final JsonSchemaConfig config; JsonSchemaMapperContext( Model model, - T shape, + Shape shape, JsonSchemaConfig config ) { this.model = model; @@ -43,7 +40,7 @@ public Model getModel() { * * @return Returns the Smithy shape. */ - public T getShape() { + public Shape getShape() { return shape; } diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperV2.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperV2.java deleted file mode 100644 index 53fe6935be5..00000000000 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperV2.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -package software.amazon.smithy.jsonschema; - -import software.amazon.smithy.model.shapes.Shape; - -public interface JsonSchemaMapperV2 extends JsonSchemaMapper { - default Schema.Builder updateSchema(Shape shape, Schema.Builder schemaBuilder, JsonSchemaConfig config) { - return schemaBuilder; - } - - /** - * Updates a schema builder. - * - * @param context Context of this schema mapping. - * @param schemaBuilder Schema builder to update. - * @return Returns an updated schema builder. - */ - Schema.Builder updateSchema(JsonSchemaMapperContext context, Schema.Builder schemaBuilder); -} diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaShapeVisitor.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaShapeVisitor.java index 1d3021a05e6..46550dfff93 100644 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaShapeVisitor.java +++ b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaShapeVisitor.java @@ -343,16 +343,10 @@ private Schema.Builder updateBuilder(Shape shape, Schema.Builder builder) { * @param builder Schema being built. * @return Returns the built schema. */ - private Schema buildSchema(T shape, Schema.Builder builder) { - JsonSchemaConfig config = converter.getConfig(); - JsonSchemaMapperContext context = new JsonSchemaMapperContext<>(model, shape, config); - + private Schema buildSchema(Shape shape, Schema.Builder builder) { + JsonSchemaMapperContext context = new JsonSchemaMapperContext(model, shape, converter.getConfig()); for (JsonSchemaMapper mapper : mappers) { - builder = mapper.updateSchema(shape, builder, config); - - if (mapper instanceof JsonSchemaMapperV2) { - builder = ((JsonSchemaMapperV2) mapper).updateSchema(context, builder); - } + builder = mapper.updateSchema(context, builder); } return builder.build(); diff --git a/smithy-jsonschema/src/test/java/software/amazon/smithy/jsonschema/JsonSchemaConverterTest.java b/smithy-jsonschema/src/test/java/software/amazon/smithy/jsonschema/JsonSchemaConverterTest.java index f7bea5ec398..c65c8b9b353 100644 --- a/smithy-jsonschema/src/test/java/software/amazon/smithy/jsonschema/JsonSchemaConverterTest.java +++ b/smithy-jsonschema/src/test/java/software/amazon/smithy/jsonschema/JsonSchemaConverterTest.java @@ -211,7 +211,30 @@ public void canUseCustomPropertyNamingStrategy() { public void canAddCustomSchemaMapper() { Shape struct = StructureShape.builder().id("smithy.example#Foo").build(); Model model = Model.builder().addShape(struct).build(); - JsonSchemaMapper mapper = (shape, builder, conf) -> builder.putExtension("Hi", Node.from("There")); + class CustomMapper implements JsonSchemaMapper { + @Override + public Schema.Builder updateSchema(Shape shape, Schema.Builder builder, JsonSchemaConfig conf) { + return builder.putExtension("Hi", Node.from("There")); + } + } + JsonSchemaMapper mapper = new CustomMapper(); + SchemaDocument doc = JsonSchemaConverter.builder().addMapper(mapper).model(model).build().convert(); + + assertTrue(doc.getDefinition("#/definitions/Foo").isPresent()); + assertTrue(doc.getDefinition("#/definitions/Foo").get().getExtension("Hi").isPresent()); + } + + @Test + public void canAddCustomSchemaMapperContextMethod() { + Shape struct = StructureShape.builder().id("smithy.example#Foo").build(); + Model model = Model.builder().addShape(struct).build(); + class CustomMapper implements JsonSchemaMapper { + @Override + public Schema.Builder updateSchema(JsonSchemaMapperContext context, Schema.Builder builder) { + return builder.putExtension("Hi", Node.from("There")); + } + } + JsonSchemaMapper mapper = new CustomMapper(); SchemaDocument doc = JsonSchemaConverter.builder().addMapper(mapper).model(model).build().convert(); assertTrue(doc.getDefinition("#/definitions/Foo").isPresent()); diff --git a/smithy-openapi-traits/src/main/java/software/amazon/smithy/openapi/traits/SpecificationExtensionTrait.java b/smithy-openapi-traits/src/main/java/software/amazon/smithy/openapi/traits/SpecificationExtensionTrait.java index eb4e24eb670..1d472dbad9e 100644 --- a/smithy-openapi-traits/src/main/java/software/amazon/smithy/openapi/traits/SpecificationExtensionTrait.java +++ b/smithy-openapi-traits/src/main/java/software/amazon/smithy/openapi/traits/SpecificationExtensionTrait.java @@ -5,8 +5,9 @@ package software.amazon.smithy.openapi.traits; +import java.util.Optional; import software.amazon.smithy.model.node.Node; -import software.amazon.smithy.model.node.ObjectNode; +import software.amazon.smithy.model.node.NodeMapper; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.traits.AbstractTrait; import software.amazon.smithy.model.traits.AbstractTraitBuilder; @@ -17,14 +18,12 @@ * smithy.openapi#specificationExtension - Indicates a trait shape should be converted into an OpenAPI specification extension. */ public final class SpecificationExtensionTrait extends AbstractTrait - implements ToSmithyBuilder { + implements ToSmithyBuilder { public static final ShapeId ID = ShapeId.from("smithy.openapi#specificationExtension"); - private static final String AS_MEMBER_NAME = "as"; - private final String as; - private SpecificationExtensionTrait(SpecificationExtensionTrait.Builder builder) { + private SpecificationExtensionTrait(Builder builder) { super(ID, builder.getSourceLocation()); this.as = builder.as; } @@ -36,53 +35,47 @@ public Provider() { @Override public Trait createTrait(ShapeId target, Node value) { - ObjectNode node = value.expectObjectNode(); - SpecificationExtensionTrait.Builder builder = builder().sourceLocation(value); - node.getStringMember(AS_MEMBER_NAME, builder::as); - SpecificationExtensionTrait trait = builder.build(); + SpecificationExtensionTrait trait = new NodeMapper().deserialize(value, SpecificationExtensionTrait.class); trait.setNodeCache(value); return trait; } } /** - * Gets the extension name for a given trait shape. - * Either an explicitly configured extension name, or a default transformation of the shape ID. + * Gets the specification extension header value in "as". * - * @param traitShapeId Trait shape to get the extension name. - * @return Extension name for the given trait shape. + * @return Returns the optionally present "as". */ - public String extensionNameFor(ShapeId traitShapeId) { - return as != null - ? as - : "x-" + traitShapeId.toString().replaceAll("[.#]", "-"); + public Optional getAs() { + return Optional.ofNullable(as); } - public static SpecificationExtensionTrait.Builder builder() { - return new SpecificationExtensionTrait.Builder(); + public static Builder builder() { + return new Builder(); } @Override protected Node createNode() { - return Node.objectNodeBuilder() - .sourceLocation(getSourceLocation()) - .withMember(AS_MEMBER_NAME, this.as) - .build(); + NodeMapper mapper = new NodeMapper(); + mapper.disableToNodeForClass(SpecificationExtensionTrait.class); + mapper.setOmitEmptyValues(true); + return mapper.serialize(this).expectObjectNode(); } @Override - public SpecificationExtensionTrait.Builder toBuilder() { + public Builder toBuilder() { return builder() .sourceLocation(getSourceLocation()) .as(this.as); } - public static final class Builder - extends AbstractTraitBuilder { + /** + * Builds a {@link SpecificationExtensionTrait} trait. + */ + public static final class Builder extends AbstractTraitBuilder { private String as; - private Builder() { - } + private Builder() {} @Override public SpecificationExtensionTrait build() { @@ -95,7 +88,7 @@ public SpecificationExtensionTrait build() { * @param as Explicit name for the target specification extension, or null. * @return This builder instance. */ - public SpecificationExtensionTrait.Builder as(String as) { + public Builder as(String as) { this.as = as; return this; } diff --git a/smithy-openapi-traits/src/main/resources/META-INF/smithy/manifest b/smithy-openapi-traits/src/main/resources/META-INF/smithy/manifest index bda299297e4..7357478d92e 100644 --- a/smithy-openapi-traits/src/main/resources/META-INF/smithy/manifest +++ b/smithy-openapi-traits/src/main/resources/META-INF/smithy/manifest @@ -1 +1 @@ -smithy.openapi.smithy \ No newline at end of file +smithy.openapi.smithy diff --git a/smithy-openapi-traits/src/main/resources/META-INF/smithy/smithy.openapi.smithy b/smithy-openapi-traits/src/main/resources/META-INF/smithy/smithy.openapi.smithy index 786fe28fb9c..0af3d334bd0 100644 --- a/smithy-openapi-traits/src/main/resources/META-INF/smithy/smithy.openapi.smithy +++ b/smithy-openapi-traits/src/main/resources/META-INF/smithy/smithy.openapi.smithy @@ -18,4 +18,4 @@ structure specificationExtension { @private @pattern("^x-.+$") -string SpecificationExtensionKey \ No newline at end of file +string SpecificationExtensionKey diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java new file mode 100644 index 00000000000..fb91434541d --- /dev/null +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.openapi; + +import java.util.LinkedHashMap; +import java.util.Map; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.openapi.traits.SpecificationExtensionTrait; +import software.amazon.smithy.utils.SmithyInternalApi; + +@SmithyInternalApi +public final class OpenApiUtils { + private OpenApiUtils() {} + + /** + * Gets the specification extension name for a given meta trait. + * + * Either an explicitly configured extension name in specificationExtensionTrait, or a normalization of the shape + * ID. The normalization replaces all "." and "#" in a shapeId to "-". + * + * @param metaTraitId Trait shape to get the extension name. + * @return Extension name for the given trait shape. + */ + public static String getSpecificationExtensionName( + ShapeId metaTraitId, + SpecificationExtensionTrait specificationExtensionTrait + ) { + return specificationExtensionTrait.getAs() + .orElse("x-" + metaTraitId.toString().replaceAll("[.#]", "-")); + } + + /** + * Return specification extensions attached to a given shape. + * + * @param shape Shape to get extensions for. + * @param model Model the shape belongs to. + * @return map of specification extension names to node values + */ + public static Map getSpecificationExtensionsMap(Model model, Shape shape) { + Map specificationExtensions = new LinkedHashMap(); + shape.getAllTraits().forEach((traitId, trait) -> + // Get Applied Trait + model.getShape(traitId) + // Get SpecificationExtensionTrait on the Applied Trait + .flatMap(traitShape -> traitShape.getTrait(SpecificationExtensionTrait.class)) + // Get specification extension name from the Applied Trait and SpecificationExtensionTrait + .map(specificationExtension -> getSpecificationExtensionName(traitId, specificationExtension)) + // Put the specification extension name and Applied Meta trait into the map. + .ifPresent(name -> specificationExtensions.put(name, trait.toNode()))); + return specificationExtensions; + } +} diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java index 10c29c91763..fa7855f681a 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java @@ -330,10 +330,7 @@ private OpenApi convertWithEnvironment(ConversionEnvironmentNote: the properties and features added by this mapper can be removed using * {@link OpenApiConfig#setDisableFeatures}. */ -public final class OpenApiJsonSchemaMapper implements JsonSchemaMapperV2 { +public final class OpenApiJsonSchemaMapper implements JsonSchemaMapper { @Override - public Schema.Builder updateSchema(Shape shape, Schema.Builder builder, JsonSchemaConfig config) { + public Schema.Builder updateSchema(JsonSchemaMapperContext context, Schema.Builder builder) { + Shape shape = context.getShape(); + OpenApiUtils.getSpecificationExtensionsMap(context.getModel(), shape).entrySet() + .forEach(entry -> builder.putExtension(entry.getKey(), entry.getValue())); + + JsonSchemaConfig config = context.getConfig(); getResolvedExternalDocs(shape, config) .map(ExternalDocumentation::toNode) .ifPresent(docs -> builder.putExtension("externalDocs", docs)); @@ -96,14 +101,6 @@ public Schema.Builder updateSchema(Shape shape, Schema.Builder builder, JsonSche return builder; } - @Override - public Schema.Builder updateSchema(JsonSchemaMapperContext context, Schema.Builder builder) { - SpecificationExtensionsMapper.findSpecificationExtensions( - context.getModel(), context.getShape(), builder::putExtension); - - return builder; - } - private void handleFormatKeyword(Schema.Builder builder, OpenApiConfig config) { String blobFormat = config.getDefaultBlobFormat(); if (config.getVersion().supportsContentEncodingKeyword()) { diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java index 3fb7f3afe8d..9e42255710f 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java @@ -5,16 +5,11 @@ package software.amazon.smithy.openapi.fromsmithy.mappers; -import java.util.Map; -import java.util.function.BiConsumer; -import software.amazon.smithy.model.Model; -import software.amazon.smithy.model.node.Node; import software.amazon.smithy.model.shapes.OperationShape; -import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.traits.Trait; +import software.amazon.smithy.openapi.OpenApiUtils; import software.amazon.smithy.openapi.fromsmithy.Context; import software.amazon.smithy.openapi.fromsmithy.OpenApiMapper; -import software.amazon.smithy.openapi.model.Component; import software.amazon.smithy.openapi.model.OpenApi; import software.amazon.smithy.openapi.model.OperationObject; import software.amazon.smithy.openapi.traits.SpecificationExtensionTrait; @@ -23,11 +18,19 @@ * Maps trait shapes tagged with {@link SpecificationExtensionTrait} into OpenAPI specification extensions. */ public class SpecificationExtensionsMapper implements OpenApiMapper { + /** + * Attach Specification Extensions to Service. + */ @Override public OpenApi after(Context context, OpenApi openapi) { - return attachAllExtensionsFromShape(openapi, context.getModel(), context.getService()); + openapi.getExtensions().putAll( + OpenApiUtils.getSpecificationExtensionsMap(context.getModel(), context.getService())); + return openapi; } + /** + * Attach Specification Extensions to Operation. + */ @Override public OperationObject updateOperation( Context context, @@ -36,27 +39,7 @@ public OperationObject updateOperation( String httpMethodName, String path ) { - return attachAllExtensionsFromShape(operation, context.getModel(), shape); - } - - private static T attachAllExtensionsFromShape(T component, Model model, Shape shape) { - Map extensions = component.getExtensions(); - findSpecificationExtensions(model, shape, extensions::put); - return component; - } - - /** - * Find all specification extension trait values attached to the given shape. - * - * @param model Model the shape belongs to. - * @param shape Shape to get extensions for. - * @param consumer Consumer called for each specification extension key-value pair found. - */ - public static void findSpecificationExtensions(Model model, Shape shape, BiConsumer consumer) { - shape.getAllTraits().forEach((traitShapeId, trait) -> - model.getShape(traitShapeId) - .flatMap(traitShape -> traitShape.getTrait(SpecificationExtensionTrait.class)) - .map(specificationExtensionTrait -> specificationExtensionTrait.extensionNameFor(traitShapeId)) - .ifPresent(name -> consumer.accept(name, trait.toNode()))); + operation.getExtensions().putAll(OpenApiUtils.getSpecificationExtensionsMap(context.getModel(), shape)); + return operation; } } diff --git a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapperTest.java b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapperTest.java index a4da2d55f53..e51a2eaed5c 100644 --- a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapperTest.java +++ b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapperTest.java @@ -2,8 +2,6 @@ import java.io.InputStream; import java.net.URL; -import java.util.stream.Stream; -import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import software.amazon.smithy.model.Model; @@ -25,20 +23,19 @@ public void checkMapping(String name) { OpenApiConfig config = new OpenApiConfig(); config.setService(ShapeId.from("smithy.example#Service")); - Node.assertEquals( - OpenApiConverter + Node actual = OpenApiConverter .create() .config(config) - .convertToNode(getModel(name)), + .convertToNode(getSpecificationExtensionTraits(name)); + Node expected = getExpectedOpenAPI(name); - getExpectedOpenAPI(name) - ); + Node.assertEquals(actual, expected); } - private static Model getModel(String name) { + private static Model getSpecificationExtensionTraits(String name) { return Model.assembler() .addImport(getResource(name + ".smithy")) - .addImport(getResource("trait-shapes.smithy")) + .addImport(getResource("specification-extension-traits.smithy")) .discoverModels() .assemble() .unwrap(); diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.openapi.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.openapi.json index 4809b7d185b..22075a3e4cd 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.openapi.json +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.openapi.json @@ -70,4 +70,4 @@ } } } -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.smithy b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.smithy index 83bcfe76203..092b9fcf669 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.smithy +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/inlined-type-target.smithy @@ -42,4 +42,4 @@ operation Operation { @aws.protocols#restJson1 service Service { operations: [Operation] -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.openapi.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.openapi.json index d9426e4bb73..da9d355dfb0 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.openapi.json +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.openapi.json @@ -46,4 +46,4 @@ } } } -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.smithy b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.smithy index 402a0482044..63c616baf3b 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.smithy +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/operation-target.smithy @@ -34,4 +34,4 @@ operation Operation { @aws.protocols#restJson1 service Service { operations: [Operation] -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.openapi.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.openapi.json index c22fef4647c..7a612271971 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.openapi.json +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.openapi.json @@ -46,4 +46,4 @@ "x-smithy-example-unionExt": { "string": "string variant" } -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.smithy b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.smithy index 7d69385b93f..9064c6971de 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.smithy +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/service-target.smithy @@ -34,4 +34,4 @@ operation Operation { @aws.protocols#restJson1 service Service { operations: [Operation] -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/trait-shapes.smithy b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/specification-extension-traits.smithy similarity index 100% rename from smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/trait-shapes.smithy rename to smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/specification-extension-traits.smithy diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.openapi.json b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.openapi.json index b9c6feaf7be..10c9fc72829 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.openapi.json +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.openapi.json @@ -70,4 +70,4 @@ } } } -} \ No newline at end of file +} diff --git a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.smithy b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.smithy index ef5b2f8184c..9058f48249d 100644 --- a/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.smithy +++ b/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy/mappers/specificationextensions/structure-target.smithy @@ -40,4 +40,4 @@ operation Operation { @aws.protocols#restJson1 service Service { operations: [Operation] -} \ No newline at end of file +}