Giter VIP home page Giter VIP logo

api-spec's People

Contributors

aubuchcl avatar blewiscycle avatar jakewarner avatar mattoni avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

api-spec's Issues

PipelineSteps has a unresolvable type mixin for rust

GIven:

PipelineSteps:
    title: PipelineStep
    description: A step for a pipeline stage.
    allOf:
      - type: object
        properties:
          identifier:
            type: string
            description: An identifier for the step.
          options:
            type: object
            properties:
              skip:
                type: boolean
      - oneOf:
          - $ref: '#/components/schemas/ImageSourceCreateStep'
          - $ref: '#/components/schemas/ImageCreateStep'
          - $ref: '#/components/schemas/ImageImportStep'
          ...

In the Rust generator I'm building, the components of allOf are built/referenced and merged into a new type. This is straightforward with a couple of objects. However the oneOf would naturally be represented as an enum like:

pub enum PipelineSteps {
    ImageSourceCreateStep(ImageSourceCreateStep),
    ImageCreateStep(ImageCreateStep),
    ImageImportStep(ImageImportStep),
    ...

There is no obvious way (to me) to mix these together in a single type.

From looking at the online cycle docs, it appears that this PipelineStep(s) should contain only the oneOf at the top level.

Some uses of type `number` when `integer` seems more apt.

For example:

cpu_cores:
    type: number
    description: The number of CPU Cores availiable for builds

In rust, at least, number is interpreted as a float.

In any case, I believe number should eschewed in favor of more explicit float or integer types.

`PrivateNetwork::legacy` is marked as required, though the api is returning `null`

I'm just getting started on testing out some live API's.

CreateEnvironment and GetEnvironments return a result of the type Environment.

Environment contains PrivateNetwork which contains LegacyNetwork.

In PrivateNetwork this field (legacy) is marked as required. For the generator, any field that is required must have a value, and can never be null, unless it is also marked as nullable. This field is not so marked. Because it is a $ref, the spec does not appear to allow a nullable flag on the property.

I'm not certain what to do here.

I think you can place nullable on the referenced definition, but that seems odd as it would then apply nullability to the property of the containing type.

If simply removing this field from the required list is possible, that would fix the generator.

Some derived models conflict with explicit models.

Some models have not been switched over to reference explicit models, deriving inline, thus conflicting in the final generation.

These are:

StackBuildInstructions (StackBuild.instructions)
StackBuildAbout (StackBuild.about)
ImageSource (Image.source)

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.