Skip to content

Conversation

@Blackjacx
Copy link

@Blackjacx Blackjacx commented Sep 9, 2020

I added and build the Apple App Store Connect spec.

Resolves #248 - App Store Connect Open API Spec Doesn't Compile

@yonaskolb
Copy link
Owner

Thanks @Blackjacx! There were some issues in master and tests weren't running. Could you please rebase off current master

@Blackjacx
Copy link
Author

Blackjacx commented Sep 10, 2020

Alright, that's done 👍 I built the spec again and now this PR has only half of the changes!?

@Blackjacx
Copy link
Author

Blackjacx commented Sep 16, 2020

Hey there, did you find the time to look into it? Generating the ASC API would be a massive time saver for me :D Tell me if I can do something.

@mikhailmaslo
Copy link

mikhailmaslo commented Sep 17, 2020

Did it work for you @Blackjacx? Cause I tried to build it and got same errors as without this PR changes (and CI check indicates the same errors)

@stherold
Copy link

stherold commented Sep 17, 2020

The happen when I run swift build on the generated files. But actually I have no clue why they happen. Yought one of you can help. It is due to how the swift files are generated I guess. This is the main problem I think (public class Links: APIModel):

self.`self` = `self`

The API model has an attribute called self which is generated as String? but as default value the generator sets

`self` 

which is not a string. Ca I change this behavior via templates?

@stherold
Copy link

Hmm your update looks good @yonaskolb but did the CI run again? It looks like it reports the same errors. I compiled the new version locally. Now the following JSON produces incorrect value (maybe this is also an error in the spec - I donw understand why they specify one of of the same type):

"AppCategoryResponse" : {
        "type" : "object",
        "title" : "AppCategoryResponse",
        "properties" : {
          "data" : {
            "$ref" : "#/components/schemas/AppCategory"
          },
          "included" : {
            "type" : "array",
            "items" : {
              "oneOf" : [ {
                "$ref" : "#/components/schemas/AppCategory"
              }, {
                "$ref" : "#/components/schemas/AppCategory"
              } ]
            }
          },
          "links" : {
            "$ref" : "#/components/schemas/DocumentLinks"
          }
        },
        "required" : [ "data", "links" ]
      }

The result is then:

public class AppCategoryResponse: APIModel {
    [...]
    public var included: [Included]?

But it should probably be:

public class AppCategoryResponse: APIModel {
    [...]
    public var included: [AppCategory]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Store Connect Open API Spec Doesn't Compile

4 participants