GithubHelp home page GithubHelp logo

seankeenan-at / optic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opticdev/optic

0.0 0.0 0.0 198.4 MB

Optic makes it easy to document your APIs, prevent breaking changes, and follow an API style-guide

Home Page: https://useoptic.com/

License: MIT License

Shell 0.02% JavaScript 0.74% TypeScript 99.23% Dockerfile 0.01%

optic's Introduction

GitHub Repo stars GitHub contributors npm license

Optic helps you ship a great API

Shipping an API is easy -- the REST is hard. We built Optic because every developer/team should be able to get the benefits of OpenAPI, without all the time/effort/costs.

๐Ÿ“‹ Documentation for all your APIs โ† write your API promises down

๐Ÿ›‘ Prevent breaking changes from shipping โ† keep your promises

โœ… Verify your API is working-as-designed (the OpenAPI and implementation are in sync) โ† make sure the API works as-designed

๐ŸŽจ Build a consistent API that follows your team's standards โ† raise the quality of your API

npm install -g @useoptic/optic

Document your existing APIs in minutes

Use real API traffic to write your initial OpenAPI specification and correctly patch the spec whenever an API changes.

  1. Use the CLI to magically capture traffic optic oas capture https://api.github.com OR provide a HAR (HTTP Archive format).
  2. Then run optic oas verify to see a list of "Undocumented" endpoints. Optic is your API version control tool, like git for APIs. "Undocumented" endpoints are like "Untracked" files in git.
  3. Add operations one at a time or use --document all to document all of them at once

Documentation: Generate an OpenAPI from traffic

document-for-web.mp4

Read Documentation

Prevent breaking changes with API diffs

Breaking changes ruin your API consumer's days. Optic prevents breaking changes from reaching production with its accurate and robust OpenAPI diff. The diff command is built to work with Git workflows, and has full support for OpenAPI 3 & 3.1, $ref, and complex schema types like oneOf/allOf/anyOf.

optic diff openapi.yaml --base main --check

Documentation: Diff OpenAPI and Catch Breaking Changes

diff-openapi.mp4

Read Documentation

Verify your API is working-as-designed

With Optic you can verify your API behavior in CI and understand your team's API Test Coverage (the % of your API functionality your testing covered). If optic oas verify detects no diffs, and you have high API Coverage, you can be very confident your API is working as designed.

optic oas verify openapi.yml

Documentation: Verify your API works as designed

verify-api-behavior.mp4

Read Documentation

Build a consistent API that follows your team's standards

Optic makes it easy for everyone on your team to review API changes, and automate your API standards. It makes API linting usable and productive for developers on teams like Snyk because it raises the quality of the APIs without getting in the way of developers.

You can read about how Optic goes beyond simple API Linting.

Here is an example of a team's automated API standards:

ruleset:
  - breaking-changes # prevent all breaking changes
  - naming:  # Naming rules apply on added properties, but won't fail on legacy
      applies: added 
      pathComponents: camelCase
      requestHeaders: Capital-Param-Case
      queryParameters: Capital-Param-Case
  - examples: # Examples in the OpenAPI are required and must match the schemas
      require_request_examples: true
      require_response_examples: true
      require_parameter_examples: true    
api-review.mp4

Read Documentation


Community & Support

License

MIT

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

All Contributors


Aidan Cunniffe

๐Ÿ“– ๐Ÿ’ป

devdoshi

๐Ÿ“– ๐Ÿ’ป

Evan Mallory

๐Ÿ“–

Jaap van Hardeveld

๐Ÿ’ป ๐Ÿ“–

Ronak Shah

๐Ÿ’ป ๐Ÿ“–

taraedits

๐Ÿ“–

Lou Manglass

๐Ÿ’ป ๐Ÿ“–

Nate Meyer

๐Ÿ’ป

Tim Gates

๐Ÿ“–

Matthew Hudson

๐Ÿ“–

LaV

๐Ÿ“–

Gaurav Nelson

๐Ÿ“–

Ross Nordstrom

๐ŸŽจ ๐Ÿ’ป ๐Ÿ›

Kin Lane

๐Ÿค” ๐Ÿ–‹

Viljami Kuosmanen

๐Ÿค” ๐Ÿ–‹

Richard Crowley

๐Ÿ”ฌ ๐Ÿค”

dnmtr

๐Ÿ‘€

Tim Perry

๐Ÿ’ป

jordaniza

๐Ÿ“–

Sandy Vanderbleek

๐Ÿ“–

Dave Rolsky

๐Ÿ“–

Baptiste Darthenay

๐Ÿ“–

Alex Miller

๐Ÿ“–

Joseph Shearer

๐Ÿ’ป

Ray Bejjani

๐Ÿ“–

Adrien Brault

๐Ÿ“–

Nicholas Lim

๐Ÿ“– ๐Ÿ’ป

Stephen Mizell

๐Ÿ’ป ๐Ÿ“–

Bojan ฤurฤ‘eviฤ‡

๐Ÿ’ป

Taras Mankovski

๐Ÿ“–

Ikko Ashimine

๐Ÿ“–

Mukesh

๐Ÿ’ป

Tony Knight

๐Ÿ“–

Roger Dickey, Jr

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

Telemetry

Optic collects telemetry which is used to help understand how to improve the product. For example, this usage data helps to debug issues and to prioritize features and improvements based on usage. The usage of our telemetry data falls under our privacy policy. While this information does help us build a great product, we understand that not everyone wants to share their usage data. If you would like to disable telemetry you can add an environment variable that will opt out of sending usage data:

OPTIC_TELEMETRY_LEVEL=off - disables telemetry (both usage, and error reporting) OPTIC_TELEMETRY_LEVEL=error - disables telemetry (only usage data is sent)

optic's People

Contributors

acunniffe avatar alexandre-herve avatar dependabot[bot] avatar devdoshi avatar jaaprood avatar nalanj avatar niclim avatar notnmeyer avatar raybejjani avatar renovate[bot] avatar smizell avatar tscott32 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.