Closed mapedd closed 2 months ago
I guess this should do the job:
accessModifier (optional): a string. Customizes the visibility of the API of the generated code.
public: Generated API is accessible from other modules and other packages (if included in a product).
package: Generated API is accessible from other modules within the same package or project.
internal (default): Generated API is accessible from the containing module only.
generator has accessModifier
config
yup, that was it
example config file for this to work:
generate:
- types
- client
accessModifier: public
@mapedd just to clear this up for others, IIUC, you could have achieved this with package, instead of public and not risk leaking these types through your public API.
Another option is to use @testable import
in your tests.
Question
I have a SPM target that uses OpenAPI Swift generator to generate client code, it's called
APIInteractor
I'd like to use this module in my tests,APIIntegrationTests
but I can't find a way to use any type that's generated, such as (in my example)Components.Schemas.EventId
.All those types are marked
internal
as they are code generated using a spm plugin. Is it possible to expose them to test target?Something like this does not help:
I'm getting:
Edit: I know this can be done if I invoke the code gen manually , but spm plugins are so awesome :)