4

Swift package plugin generates code from OpenAPI docs

 7 months ago
source link: https://www.infoworld.com/article/3712784/swift-package-plugin-generates-code-from-openapi-docs.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Swift package plugin generates code from OpenAPI docs

Swift OpenAPI Generator generates the Swift client or server code needed to make API calls or implement API servers.

By Paul Krill

Editor at Large,

InfoWorld | Feb 1, 2024 1:00 pm PST

shutterstock 2227591131 common Swift bird in flight over sunlit green grass

Per Grunditz / Shutterstock

Apple has released the stable 1.0 version of the Swift OpenAPI Generator 1.0, for generating Swift client and server code from an OpenAPI document, Swift developers announced on January 31.

Swift OpenAPI Generator generates the code needed to make API calls or implement API servers. The code is generated automatically at build time, so it is in sync with the OpenAPI document and does not need to be committed to a source repository. OpenAPI is an open standard for describing the behavior of HTTP services, and features an ecosystem of tools.

Swift OpenAPI Generator works with OpenAPI Specification versions 3.0 and 3.1. It supports streaming request and response bodies, backed by AsyncSequence, enabling use cases such as large payloads without buffering and JSON event streams. It supports common content types including JSON, URL-encoded form, Base64, plain text, and raw bytes, all of which are represented as value types with type-safe properties, and offers flexible client, server, and middleware abstractions, decoupling the generated code from the HTTP client library and web framework.

With Swift OpenAPI Generator, code can be generated to make type-safe requests to an API server with any HTTP client library. The plugin also can generate code to bootstrap an HTTP server with any web framework using business logic that is decoupled from network requests.

0 seconds of 29 secondsVolume 0%
This ad will end in 29

Paul Krill is an editor at large at InfoWorld, whose coverage focuses on application development.

Copyright © 2024 IDG Communications, Inc.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK