Skip to content

Error type in composed struct #22

Description

@kikeenrique

Hi!

First of all, I want to thank you for your work, I really love ❤️ this project, I've been waiting for a tool like this (sourcery+plantuml) for quite a long time!

Next, I've found a problem that I don't if it's a bug or I'm missing something.

I've two files:

Container.swift
public struct Container: Codable {

    public var url: String
    public var headers: ContainerHeaders?

    public init(url: String, headers: ContainerHeaders? = nil) {
        self.url = url

        self.headers = headers
    }

    public enum CodingKeys: String, CodingKey {
        case url
        case headers
    }
}
ContainerHeaders.swift
public struct ContainerHeaders: Codable {

    public var name: String
    public var value: String

    public init(name: String, value: String) {
        self.name = name
        self.value = value
    }
}

With those, I try to generate a diagram using this command

swiftplantuml classdiagram  Container.swift ContainerHeaders.swift --sdk $(xcrun --show-sdk-path -sdk macosx) --output consoleOnly

Which results in an error, as it can bee seen in the output given:

@startuml
' STYLE START
hide empty members
skinparam shadowing false
' STYLE END


class "Container" as Container << (S, SkyBlue) struct >> {
  +url : String
  +headers : <<error type>>
  +init(url:headers:)
}
class "ContainerHeaders" as ContainerHeaders << (S, SkyBlue) struct >> {
  +name : String
  +value : String
  +init(name:value:)
}
Container --|> Codable : inherits
ContainerHeaders --|> Codable : inherits

@enduml

So, is this a bug or do I miss something?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingworkaround-possibleThis issue can be mitigated by a workaround

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions