Giter Site home page Giter Site logo

can's Issues

Feature: Proper windows path compatibility

We're currently wrapping paths in filepath.Clean() in the hopes that the filepath package will handle a lot of the os-specific path formatting. This isn't thoroughly tested and we should adopt the community best practice on how this should be done.

Interfaces generated for multiple paths clutter up `Server{}` interface

Consider grouping multiple function signatures into their own path-named interface. This will allow the Server interface to remain uncluttered as it can be composed by-endpoint as opposed to including every signature definition.

Current

type Server interface {
  DomainDelete(*gin.Context, *models.DomainDeleteRequest) models.DomainDeleteResponse
  DomainGet(*gin.Context, *models.DomainGetRequest) models.DomainGetResponse
  DomainPatch(*gin.Context, *models.DomainPatchRequest) models.DomainPatchResponse
  DomainPost(*gin.Context, *models.DomainPostRequest) models.DomainPostResponse
  ProjectDelete(*gin.Context, *models.ProjectDeleteRequest) models.ProjectDeleteResponse
  ProjectGet(*gin.Context, *models.ProjectGetRequest) models.ProjectGetResponse
  ProjectPatch(*gin.Context, *models.ProjectPatchRequest) models.ProjectPatchResponse
  ProjectPost(*gin.Context, *models.ProjectPostRequest) models.ProjectPostResponse
  ProjectListGet(*gin.Context, *models.ProjectListGetRequest) models.ProjectListGetResponse
}

For improved organization

type Server interface {
  DomainInterface
  ProjectInterface
}

Always include a Response model for unimplemented requests, defined by config value

We generate a base Struct that represents an unimplemented server from which a concrete server can be composed.
This unimplemented server currently returns the status code defined by InvalidRequestStatus in the config file.

This should change to a config option called UnimplementedResponseCode and a model should always be generated for it for every request.

Release with default configuration file

This would allow the application to be plug and play for most applications that fit it's initial use case.
Alternatively one could hardcode the config file and allow for a template to be sent to stdout for capture by the user intending to set their own config to feed in via the intended CLI flag

go-client: Required Tag for property does not function correctly

                  domains:
                    type: array
                    required: [domain]
                    items:
                      type: object
                      required: [name, enabled]
                      properties:
                        explicit_domain_id:
                          type: string
                        id:
                          type: string
                        name:
                          type: string
                        description:
                          type: string
                        enabled:
                          type: boolean

An open api definition such as this does not cause the generated code to omit the omitempty json tag for the domain, name, and enabled fields in the generated structs.

Formalise Name Inference rules for models

Schemas do not have names in the OpenAPI Spec.
Model objects in code need names.

Name inference therefore needs to be a thing.
The most obvious name inference rule is to sanitise $refs into model names.
Unfortunately, they are not always available.

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.