OpenAPISwiftCodeGenerate is an extension of ServiceModelSwiftCodeGenerate that can be used to generate code based on OpenAPI/Swagger service models. This library can be integrated into higher level code generation applications.
Getting Started
Step 1: Add the OpenAPISwiftCodeGenerate dependency
OpenAPISwiftCodeGenerate uses the Swift Package Manager. To use the framework, add the following dependency
to your Package.swift:
OpenAPIServiceModel and SwaggerServiceModel both implement the ServiceModel protocol so they can be passed into the ServiceModelGenerate.generateFromModel function defined in ServiceModelSwiftCodeGenerate.
OpenAPISwiftCodeGenerate
OpenAPISwiftCodeGenerate is an extension of ServiceModelSwiftCodeGenerate that can be used to generate code based on OpenAPI/Swagger service models. This library can be integrated into higher level code generation applications.
Getting Started
Step 1: Add the OpenAPISwiftCodeGenerate dependency
OpenAPISwiftCodeGenerate uses the Swift Package Manager. To use the framework, add the following dependency to your
Package.swift
:Step 2: Use the library to generate code
OpenAPIServiceModel
andSwaggerServiceModel
both implement theServiceModel
protocol so they can be passed into theServiceModelGenerate.generateFromModel
function defined in ServiceModelSwiftCodeGenerate.For example, given the following code generator:
OpenAPI and Swagger files can be parsed as follows:
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.