Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The fairytales about API deployments

Daniel Kocot
September 12, 2022

The fairytales about API deployments

Daniel Kocot

September 12, 2022
Tweet

More Decks by Daniel Kocot

Other Decks in Technology

Transcript

  1. "The good must be put in the dish, the bad

    you may eat if you wish." - The fairytales about API deployments Daniel Kocot, Senior Solution Architect / Head of API Experience & Operations
  2. Name: Daniel Kocot Role: Senior Solution Architect / Head of

    API Experience & Operations Email: Twitter: @dk_1977 LinkedIn: [email protected] https://www.linkedin.com/in/danielkocot/
  3. What does "Full Lifecycle" mean? Writing API definitions not from

    scratch Using an API Design Library Linting API definitions from the beginning of the writing process Using Contract, Content, Variation and Integration Tests Deploying API Definitions to specific targets Using pipelines to automate the things Observability
  4. API first An API is the first (and often only)

    interface to users of an application An API comes first — before the implementation An API is described (documented) or self-descriptive
  5. Use of OpenAPI Extensions/X-Objects to handle own or vendor needs

    x-vendor-…​ x-…​ Supported by: root level info paths operation parameters responses tags security schemes
  6. Linting - Spectral Ruleset extends: spectral:oas rules: contact-properties: info include-title:

    description: Info section has to include a title as identifying name of the API. given: $.info severity: error then: field: title function: truthy include-version: description: Info section has to include a version following semantic rules. given: $.info severity: error then: field: version function: truthy valid-semantic-version: description: Versions are restricted to the format <MAJOR>.<MINOR>.<PATCH>, e.g. 1.0.0. See http given: $.info severity: error then: field: version function: pattern
  7. Tests docker run --init -v $(pwd)/output:/tmp --name prism-container --rm -d

    -p 4010:4010 stoplight/prism: npx @apideck/portman@latest -l output/news.yaml -o output/newsCollection.json -n true -c portman-con docker stop prism-container
  8. Test Configuration Creating YAML file(s) to configure the test types

    References are possible { "version": 1.0, "tests": { "contractTests": [], "contentTests": [], "variationTests": [], }, "globals": { "stripResponseExamples": true } }
  9. Variation Testing With contract testing we only tested the success

    known as the "happy path" With variation testing we have the happy path and the unhappy path With the unhappy path we want to verify that the API response is matching with the expected error response
  10. Testing Artifacts After the tests we receive two artifacts bundled

    API definition Postman Collection in reference to the definition Both are now linted and tested
  11. Deploy Depending on the deployment target Push of the OpenAPI

    Definition Converting the API definition to some Configuration as Code
  12. Gateway to manage and secure the API infrastructure component highly

    configurable governed by guidelines and automated deployments
  13. Portal stands beside the gateway as a separate component also

    one portal for several gateways can possible Configuration should be also be done by separate pipeline
  14. Hub on a higher level than the portal acts more

    like a umbrella for complex infrastructure is the first step towards an internal developer platform
  15. Registry stores artifacts like API definitions similar to schema registry

    we know supports again the idea of an internal developer platform but more technical
  16. Q&A