GithubHelp home page GithubHelp logo

speakeasy-api / cli Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 10.45 MB

Track the state of your API and orchestrate your API lifecycle from code to artifacts to infra. Manage your APIs with ease !

License: Apache License 2.0

Go 90.85% Ruby 9.15%
api api-platform api-testing apiops cli golang request-logging rest state

cli's People

Contributors

alexadrake avatar anuraagnalluri avatar goreleaserbot avatar simplesagar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Switch brew tap back to "api"

Switch brew tap back to api - currently it is brew install speakeasy-api/homebrew-taps/cli which results in the command line tool executable being named cli

Acceptance Criteria:

  • Executing brew install speakeasy-api/homebrew-taps/cli results in executable on home path with api alias.

Required input / outputs

Priority for post-parsing fix: How do we show if a sub-object of a request object is required? We only have annotations for the top object.
say we have:
// @Param type body input.MerchantStatement true "Request schema"

where the input.MerchantStatement object is required, and MerchantStatement looks like:

type MerchantStatement struct {
   Type     models.StatementType `json:"type"`
   FileType *StatementFileType    `json:"file_type,omitempty"`
}

How in API specs, do we intent to be able to mark sub fields of an object with mandatory or not (say Type was mandatory but FileType was not)? Will Speakeasy look at the json tags or object type?

Aliasing imports are not found

Bolt often uses aliases for package imports.

Example: import api_views "hail/services/api/views" instead of import hail/services/api/views.

When parsing response / request objects, Speakeasy cannot find the reference for an aliased object ("cannot find type definition: api_views.Model1") but can find if its views.Model1.

We have many "views" subpackages. Renaming all our packages might be a challenge. Do you think it would be possible to look through the objects referenced by their alias name?

Adding in annotations for endpoints only works if the request object is empty

Adding in annotations for endpoints only works if the request object is empty. added in an annotation for a new handler with:

// .... 
// @Param merchantStatement body input.MerchantStatement true "Merchant statement to sign"
// ....

where input.MerchantStatement is the input object type.
If this input object is empty then a spec is generated.
If this input has a primitive type like:

type MerchantStatement struct {
   Date     float64              `json:"date"`
}

Then NO SPEC is generated with seg violation (invalid memory address or nil pointer)
if this input has any other references or types in the object like a typed object, it also throws an error.
Adding command line result in thread

Slack: https://speakeasyapi.slack.com/archives/C03BEMS60GZ/p1652809174457429

BUG - Wrong indentation in yaml when trying to add tags

I tried to add a tag for an endpoint with:

// @title Shopper Accounts Public API
// @Version v1.0
// @description This API documents the different endpoints under Bolt's API Account section.
// @Tag.name Account

but I got an error in the yaml file because of a formatting / indentation problem: I think there is missing 2 indentations for the tag annotation.

68:1 error wrong indentation: expected 2 but found 0 (indentation)
image

Redundant Path annotation when router grouping pattern exists

Slack: https://speakeasyapi.slack.com/archives/C03BEMS60GZ/p1651184009523929

For Speakeasy, we need to annotate each handler with // @Router /v1/endpoint/path_a [post] . However, we already have this information because each of our routes has a Pattern with the same information

router.Route{
					Name:       "name of handler",
					Method:     http.MethodPost,
					Pattern:    "/v1/endpoint/path_a",
					APIHandler: apiApp.Handler,
},

It would reduce redundant dev work if we didn't need to have the extra annotations in both places

Acceptance Criteria:

  • Code parser should recognise the presence of a route grouping and automatically infer path information

Do not fill in annotations left blank

If an optional annotation field is left out, can we just **not ** include it in the yaml/json, rather than having it in as empty. For example, we probably will not fill in the license section for open api. Currently this is populated, with an error / warning because if the license attribute is included, then identifier needs to exist.

I don't think this is high priority as it can be deleted but it would be nice to not populate empty fields that we leave blank
image

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.