Package software.amazon.smithy.openapi
Class OpenApiUtils
java.lang.Object
software.amazon.smithy.openapi.OpenApiUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetSpecificationExtensionName(software.amazon.smithy.model.shapes.ShapeId metaTraitId, software.amazon.smithy.openapi.traits.SpecificationExtensionTrait specificationExtensionTrait) Gets the specification extension name for a given meta trait.getSpecificationExtensionsMap(software.amazon.smithy.model.Model model, software.amazon.smithy.model.shapes.Shape shape) Return specification extensions attached to a given shape.
-
Method Details
-
getSpecificationExtensionName
public static String getSpecificationExtensionName(software.amazon.smithy.model.shapes.ShapeId metaTraitId, software.amazon.smithy.openapi.traits.SpecificationExtensionTrait specificationExtensionTrait) 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 "-".- Parameters:
metaTraitId- Trait shape to get the extension name.- Returns:
- Extension name for the given trait shape.
-
getSpecificationExtensionsMap
public static Map<String,software.amazon.smithy.model.node.Node> getSpecificationExtensionsMap(software.amazon.smithy.model.Model model, software.amazon.smithy.model.shapes.Shape shape) Return specification extensions attached to a given shape.- Parameters:
shape- Shape to get extensions for.model- Model the shape belongs to.- Returns:
- map of specification extension names to node values
-