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

Moonwalk the OpenAPI talk. Developer Experience...

Moonwalk the OpenAPI talk. Developer Experience and OpenAPI 4

Swagger and OpenAPI revolutionized the API landscape and created a thriving ecosystem of developer tools, from IDEs to contract testing and no-code solutions. In our projects (WireMock, Jenkins, Testcontainers, and WireMock Cloud) we adopted OpenAPI to provide a great developer experience including automated generation of plugins, pipeline integrations, and the creation of Mock APIs directly from OpenAPI definitions. Not everything went well. OpenAPI excels at documentation but not so much for machine processing. We had to craft our own tooling, apply some AI magic to reverse engineer specifications, and build behavioral models. Most of it could have been prevented if OpenAPI v3 was more flexible and extensible.

In this talk we will discuss using OpenAPI for service modeling, also known as "mocking" and its impact on developer experience. Then, we will discuss the current limitations of OpenAPI 3 and offer a glimpse into the anticipated enhancements in OpenAPI v4 "Moonwalk," which are to be released soon.

Oleg Nenashev

December 03, 2024
Tweet

More Decks by Oleg Nenashev

Other Decks in Technology

Transcript

  1. Oleg Nenashev Lead Developer Advocate, Gradle December 3, 4 &

    5, 2024 Moonwalk the OpenAPI talk Developer Experience and OpenAPI 4
  2. Oleg Nenashev - Online Edition @oleg_nenashev oleg-nenashev Dr. Nenashev /

    Mr. Jenkins Community Builder Developer Tools Hacker DevRel Consultant #RussiansAgainstPutin #StandWithUkraine
  3. Disclaimer • I am an OpenAPI user/developer, not a core

    contributor • I am sharing an outsider perspective, and not an official opinion • Kudos to the OpenAPI team for reviews and feedback (this is v2)! • Happy to be wrong • The OpenAPI roadmap is driven by contributors, you’re welcome! 6
  4. Is OpenAPI a FORMAL Specification? 7 In computer science, formal

    specifications are mathematically or algorithmically based techniques whose purpose are to help with the implementation of systems and software.
  5. Example: OpenAPI plugins for Gradle 100+ related Gradle plugins Libraries

    and integrations in any [modern] framework (!) OpenAPI Generator 15
  6. Example: OpenAPI Generator 16 https://openapi-generator.tech/ Application Programming Interface • Automates

    the creation of ◦ client libraries, ◦ server stubs, ◦ API documentation, ◦ and configuration files • from an OpenAPI Spec Input: Output:
  7. Example: Develocity 18 • Not just OpenAPI, but an API

    Manual ◦ docs.gradle.com/develocity/api-manual • Versioning and Depreciation policy via OpenAPI annotations • User-friendly changelogs
  8. For many FOSS projects: we sponsor Develocity licenses/hosting API for

    integration and developer pipelines Maven, Bazel and sbt users welcome! gradle/develocity-oss-projects gradle/develocity-oss-projects
  9. ◦ Build Scan and Troubleshooting ◦ Local and Distributed build

    caching ◦ Predictive Test Selection ◦ CI/CD observability and Insights ◦ Local build observability Public Develocity Instance: ge.openapi-generator.tech We support OpenAPI Generator 20
  10. 25 The UNIX way Peter H. Salus, A Quarter-Century of

    Unix (1994) • Write programs that DO ONE THING and DO IT WELL • Write programs to WORK TOGETHER • Write programs to handle text streams, because that is a UNIVERSAL INTERFACE
  11. APIs are the Key for Developer Productivity 27 response request

    Client App Server HTTP/2 Storage response request API API
  12. 29

  13. Disclaimer We are not yet at the point of writing

    a formal specification, … We will begin writing a formal document once enough decisions have been made through ADRs that a coherent document can be structured. 40 https://github.com/OAI/sig-moonwalk
  14. OpenAPI 4 “Moonwalk” Project Evolve the OpenAPI Specification to: 1.

    Address limitations in OpenAPI 3.x 2. More expressive API definitions, including support for advanced use cases 3. Improve user/developer experience 4. Encourage contributions and ecosystem growth 41 https://github.com/OAI/moonwalk
  15. OpenAPI 4 “Moonwalk” Features • Support APIs that have different

    responses based on query parameters, headers and request bodies. • Broader range of URL design patterns • Reduce nested structures to improve readability and editability • Improve reusability of request and response patterns 43 https://github.com/OAI/moonwalk
  16. Broader range of URL Design Patterns • “hey there’s a

    standard for that, let’s use it!” • Moonwalk to be compliant with the URI RFC ◦ https://datatracker.ietf.org/doc/html/rfc3986 46
  17. Look at OpenAPI from the Earth • Sporadic activity in

    the SIG Moonwalk repo • No signal from June 2024? Not exactly • Chat and meetings remain active 47 Chandrayaan-3: https://timesofindia.indiatimes.com/india/chandrayaan-3-no-signal-from-vikram-pragya n-yet-can-wait-entire-lunar-day-says-isro-chief/articleshow/103892424.cms
  18. Moonwalk is a Path not a destination (milestone) 48 Source:

    https://www.pinterest.com/pin/1650 14773818878116/
  19. Path to Moonwalk (unofficial) • No more 4.0. big bang

    in 2024/2025 • Some features to land in OpenAPI 3.x ◦ 3.2 (soon) - Quality of Life patches ◦ 3.3 (late 2025) - larger scale topics, parameter styles, schemas/etc. • Plans depend on the contributor availability, help needed! 49 Credits to: Henry Andrews #spec on the OAI Slack
  20. OpenAPI 4 “Moonwalk” Wishlist: Overlay Specifications to become a part

    of the standard aka “openapi-patch” - injecting duplicated content into the specs spec.openapis.org/ove rlay/v1.0.0.html 55 Source: https://www.youtube.com/watch?app=desktop&v=Iiygq3r1QPs
  21. Open API as Code • JSON/YAML extensions are not great

    • OpenAPI specifications are huge and not sustainable as is • It is an interexchange format • 99% of specs are generated by tools • We need OpenAPI DSLs 56
  22. Example: Develocity API 60 openapi: 3.0.3 info: title: Develocity API

    description: > Allows programmatic interaction with Develocity, from config to build data version: "2024.2" license: name: Develocity License url: https://gradle.com/legal-gradle-software-license-agreement termsOfService: https://gradle.com/help/legal-terms-of-use x-logo: url: https://assets.gradle.com/logo/develocity-logo.svg altText: Develocity docs.gradle.com/develocity/api-manual/ #reference_documentation
  23. Example: Develocity API 61 … tags: - name: BuildCache x-displayName:

    Build Cache description: | Endpoints related to configuring the Build Cache nodes of the Develocity instance. To access these endpoints the user requires the `Configure build caches` permission. - name: Projects x-displayName: Projects (Beta) description: | Endpoints related to the management of projects in Develocity. To access these endpoints the user requires the `Administer Projects` permission. docs.gradle.com/develocity/api-manual/ #reference_documentation
  24. 62

  25. Where did we see “x-”tensions? • Authorization model • Parameter

    values for samples • Feature flags • Conditions • Stateful behavior • … 63 Image source: orchid-tech.com/design-notes/ fpga-complex-algorithm-development/
  26. Moonwalk Wishlist: Extensions Registry • We got types and namespaces

    registry, great! • Alternative API spec formats (e.g. JSON Schema) 66 spec.openapis.org/registry
  27. Where did we see “x-”tensions? • Authorization model • Parameter

    values for samples • Feature flags • Conditions • Stateful behavior • … 68
  28. 69

  29. • OpenAPI Initiative Subproject • API Workflow definitions • “Stateful

    Behavior” 71 https://github.com/OAI/Arazzo-Specification
  30. Contributing to Moonwalk As of March 2024, we are using

    the following documents and processes: • The Initial Moonwalk Proposals launched this effort, and continue to serve as the reference point for our discussions • Discussions: All Moonwalk ideas should start as discussions • Architectural Design Records (ADRs) as discussions produce consensus, decisions are recorded as ADRs • Issues should only be used to track actionable work items • Meeting Agendas focus the discussion in our weekly calls, which are open to all and are often where we decide discussions are ready for ADRs 74
  31. If you consume OpenAPI based specs 75 • Productize API

    - documentation, tools, versioning and maintenance • Keep your OpenAPI version up to date • Push your API vendors to update specs • Invest in [API] Developer Productivity and tooling
  32. If you develop specs with OpenAPI 76 • Contribute Back!

    Templates/Extensions • Try out Moonwalk, share feedback • Need more? OpenAPI Extensions are an engine to consider
  33. OpenAPI is driven by contributors. It’s [always] a great time

    to participate! communityinviter.com/apps/open-api/openapi openapis.org/participate/how-to-contribute 77
  34. References • These slides: https://speakerdeck.com/onenashev/ • Moonwalk SIG: https://github.com/OAI/sig-moonwalk •

    2024 plans for Moonwalk: openapis.org/blog/2023/12/06/openapi-moonwalk-2024 • Features Overview: apisyouwonthate.com/blog/openapi-v4-project-moonwalk 79