AvdLee / appstoreconnect-swift-sdk

The Swift SDK to work with the App Store Connect API from Apple.
Other
1.48k stars 198 forks source link

Fix diagnostic log return types #218

Closed mkj-is closed 1 year ago

mkj-is commented 1 year ago

Perf power metrics and one diagnostic requests return Data instead of Codable models. Codable models are generated, but the body type schema is not used correctly. This is due to some Apple-specific content-types which are specified in the OpenAPI spec. Hopefully, CreateAPI provides configuration to override such body types.

Also fixes following warnings in the make generate step.

WARNING: Unknown body content types: [OpenAPIKitCore.OpenAPI.ContentType(underlyingType: OpenAPIKitCore.OpenAPI.ContentType.Builtin.other("application/vnd.apple.xcode-metrics+json"), warnings: [], parameters: [:])], defaulting to Data. Use paths.overridenBodyTypes to add support for your content types.
WARNING: Unknown body content types: [OpenAPIKitCore.OpenAPI.ContentType(underlyingType: OpenAPIKitCore.OpenAPI.ContentType.Builtin.other("application/vnd.apple.xcode-metrics+json"), warnings: [], parameters: [:])], defaulting to Data. Use paths.overridenBodyTypes to add support for your content types.
WARNING: Unknown body content types: [OpenAPIKitCore.OpenAPI.ContentType(underlyingType: OpenAPIKitCore.OpenAPI.ContentType.Builtin.other("application/vnd.apple.diagnostic-logs+json"), warnings: [], parameters: [:])], defaulting to Data. Use paths.overridenBodyTypes to add support for your content types.

There is a typo in the overridenBodyTypes configuration key in version 0.5.0 of CreateAPI (fixed in 1.0.0). I recommend updating it.

SwiftLeeBot commented 1 year ago
Fails
:no_entry_sign: `danger-swift` failed.

Log

/var/folders/11/nh0v1jld7zd7b9zqm1774gtm0000gn/T/_tmp_dangerfile.swift:1:8: error: no such module 'Danger'
import Danger
       ^
ERROR: Dangerfile eval failed at Dangerfile.swift
ERROR: Could not get the results JSON file at /var/folders/11/nh0v1jld7zd7b9zqm1774gtm0000gn/T/danger-response.json


Generated by :no_entry_sign: dangerJS against 0a4bf246a19f017e0d489253f6867f522ef92609

mkj-is commented 1 year ago

Running fastlane test locally succeeded for me. I see all recent Bitrise builds failed, looks unrelated to this PR.

github-actions[bot] commented 1 year ago

This PR is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

mkj-is commented 1 year ago

@AvdLee Can you have a look at this PR? It was marked stale, because there was no answer. There is a failure on CI, but it looks unrelated to changes in this PR. Locally tests are passing.