Git Product home page Git Product logo

connect-api-specification's Introduction

Connecting to the Square API

This is the project that generates API clients for connecting to the public Square API. You probably want to just use one of the clients that are pre-built in a language of your choice:

The Connect Examples are working sample applications that you can copy from to build your own.

Connect API Specifications

This repository contains the specifications for generating client SDKs with Swagger/OpenAPI.

The canonical specification is defined in api.json. The templates for our supported SDKs are located in swagger-templates. The configuration for each SDK (e.g. name of the library, version number, etc.) are located in swagger-config.

Configure a new language

Generating an SDK for a new language is possible. You'll need to have a working version of swagger-codegen and follow these steps:

  1. Check if Swagger Codegen supports the language by running:
    swagger-codegen langs
  2. If the language is supported, note swagger's name for it. We'll call it {lang}
  3. Add a configuration file on swagger-config named config-{lang}.json. You can check this template.
  4. Create a directory on swagger-templates named {lang}. Generation scripts expect to have a folder even if no custom templates are included:
    mkdir $lang
  5. (Optional) Add custom templates for your generator. Check Swagger Codegen Readme.

Generating and Downloading New Swagger Specs

Swagger specifications are now generated in our new pipeline, using the oas-pipeline tool. You will need the build id for an OAS generated with the tool in production. The Swagger Spec can then be generated with the following command:

oas-pipeline generate swagger <build_id>

Once the Swagger generation has succeeded, the spec files can be downloaded and pushed to a release branch with the following command:

./script/internal/download-swagger-specs.sh <build_id>

Note: the build id must be from a production environment build.

Contributing

See CONTRIBUTING.md.

License

Copyright 2016 - 2018 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

connect-api-specification's People

Contributors

alecholmes avatar alecsquare avatar bunnyc1986 avatar dange42 avatar deanpapastrat avatar drbyte avatar gkchestertron avatar hukid avatar jackdanger avatar jawspeak avatar jessdelacruzsantos avatar lindzeng avatar longboardcat avatar mikekono avatar mikeralphson avatar okenshields avatar shaofu88 avatar stephenbarlow avatar ti55987 avatar tristansokol avatar yonpols avatar

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.