GithubHelp home page GithubHelp logo

alloy's Introduction

Alloy

A collection of commonly used Smithy shapes.

Table of Contents

Why Alloy?

Alloy is smithy library that contains traits and protocols that are not currently provided by the smithy standard library. Alloy can be seen as a companion library to the smithy standard library (smithy.api).

The goals of alloy are :

  • provide traits aiming at expressing protobuf/gRPC semantics in smithy
  • provide traits allowing to capture patterns and constraints that are common in the industry (some related to http APIs, some more general)

Core alloy library

The core alloy library, containing shapes and validators, is published to Maven Central at the following coordinates.

com.disneystreaming.alloy:alloy-core:x.y.z

It contains, in particular, traits and validators associated to the following aspects :

Constraints and behavioural traits

Alloy provides a number of constraint and behavioural traits that may be leverage by tooling and protocols.

Serialisation

Alloy defines a number of behavioural traits that can be leveraged by protocols to tweak serialisation. In particular for the following formats :

Protocols

Alloy defines two protocols :

Protocol Compliance Module

Alloy provides a suite of protocol tests that utilise the [AWS HTTP Protocol Compliance Test Module]("https://smithy.io/2.0/additional-specs/http-protocol-compliance-tests.html. These tests accompany the specification of the alloy#simpleRestJson protocol, allowing implementations of that protocol to build confidence that the implemented behaviour is correct as per the specification.

These tests are available on maven central at the following coordinates :

com.disneystreaming.alloy:alloy-protocol-tests:x.y.z

Working on Alloy

Publish Local

> ./mill __.publishLocal

Run Tests

> ./mill __.test

alloy's People

Contributors

astridej avatar baccata avatar ckipp01 avatar daddykotex avatar dhpiggott avatar ghostbuster91 avatar igor-ramazanov avatar kubukoz avatar lewisjkl avatar mergify[bot] avatar miguel-vila avatar scala-steward avatar yisraelu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

alloy's Issues

`JsonName` ignored in examples when generating swagger docs

If a structure member has a custom @JsonName:

$version: "2.0"
namespace example.hello
operation Hello {
    output: Greeting
}
structure Greeting {
    @required
    @jsonName("msg")
    message: String
}
apply Hello @examples([
    {
        title: "My name is Jeff"
        output: {
            message: "Hello Jeff"
        }
    }
])

the generated swagger doc for the above service would ignore the @JsonName and use message instead of msg:

Screenshot 2024-03-08 at 01 46 56

I think this is wrong. Smithy docs mention useJsonName which might be of relevance but I couldn't find a way of setting that in the interface provided by smithy4s.http4s.swagger.docs.

Also note that in my example, I had to provide the output example as a smithy structure rather than a json. ie {message: "Hello Jeff"} rather than msg, which I'd argue, is a little counter intuitive for the reader. I understand this is perhaps one for smithy but do we know if it Would be possible to specify examples in json rather than smithy structures? ๐Ÿค”

Alloy OpenApi module import issue

When adding "com.disneystreaming.alloy:alloy-openapi:x.x.x" as
val alloyOpenApi = "com.disneystreaming.alloy" % "alloy-openapi" % AppVersions.alloy
sbt fails to retrieve the module. After I took a look at maven central it seems it is only published with the _2.12 and _2.13 suffixes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.