Skip to content

Releases: mczachurski/Swiftgger

Support for dictionaries in response/request body

26 Jun 08:14
Compare
Choose a tag to compare

Now we can use dictionaries in request/response body. For example:

let openAPIBuilder = OpenAPIBuilder(
    title: "Swiftgger OpenAPI document",
    version: "1.0.0",
    description: "OpenAPI documentation for test structure purposes",
    authorizations: [
        .basic(description: "Basic authorization"),
        .apiKey(description: "Api key authorization"),
        .jwt(description: "JWT authorization"),
        .oauth2(description: "OAuth authorization", flows: [
            .implicit(APIAuthorizationFlow(authorizationUrl: "https://oauth2.com", tokenUrl: "https://oauth2.com/token", scopes: [:]))
        ]),
        .openId(description: "OpenIdConnect authorization", openIdConnectUrl: "https//opeind.com")
    ]
)
.add([
    APIObject(object: Fuel(level: 90, type: "GAS", productionDate: Date(), parameters: ["power", "speed"])),
])
.add(APIController(name: "VehiclesController", description: "Contoller for vehicles", actions: [
    APIAction(method: .get,
              route: "/vehicles/tags",
              summary: "Get vehicle associated tags",
              description: "GET action for downloading vehicle associated tags.",
              responses: [
                APIResponse(code: "200", description: "Vehicle tags", type: .dictionary(String.self)),
                APIResponse(code: "401", description: "Unauthorized")
              ]
    ),
    APIAction(method: .get,
              route: "/vehicles/fuels",
              summary: "Get vehicle associated fuels",
              description: "GET action for downloading vehicle associated fuels.",
              responses: [
                APIResponse(code: "200", description: "Vehicle fuels", type: .dictionary(Fuel.self)),
                APIResponse(code: "401", description: "Unauthorized")
              ]
    )
]))

let openAPIDocument = openAPIBuilder.built()

Above code will produce response which in Swagger is displayed like on below image.

image

Support for key encoding strategy

13 Jun 17:19
213bf64
Compare
Choose a tag to compare
Pre-release

In the release we have mainly to changes:

Both changes introduces breaking changes.

Fixes in OpenAPI data structures and UUID support

09 Jun 16:53
25d9ea8
Compare
Choose a tag to compare

Version contains fixes in OpenAPI data structures and UUID support. Also first implementation of Swift file generator has been added. Now we can basically generate Swift files with model classes.

Suport for Property Wrappers

25 Jan 20:14
Compare
Choose a tag to compare
1.4.2

#16 Fix list of required properties with .

Support of custom API Key name and location

24 Jan 19:35
Compare
Choose a tag to compare
1.4.1

Add support for custom API Keys names/locations

Nested objects and examples improvements

24 Jan 13:55
Compare
Choose a tag to compare
1.4.0

Fix link to OpenAPI specification

Support for custom object names

12 Mar 09:23
Compare
Choose a tag to compare

New version add posibilities to rename object names. We can hide internal class names and show more user friendly names:

APIObject(object: SpaceshipDTO(name: "Star Trek", speed: 923211), customName: "Spaceship")

Support for OpenAPI DataTypes

03 Feb 07:49
5363087
Compare
Choose a tag to compare
Merge pull request #3 from eneko/master

Add support for OpenAPI DataTypes