Skip to content

Conversation

@stefanadranca
Copy link
Collaborator

@stefanadranca stefanadranca commented Nov 27, 2023

Created the SorceFile struct that represents the file to be created by the code generator.

Motivation:

The CodeRenderer needs to create objects of some type representing the files containing the
generated code. This type is SourceFile.

Modifications:

Implemented the SourceFile struct, containing the base name and the generated code as strings.

Result:

The Code Renderer can now be brought from the OpenAPI generator, as it will have an output type.
The code generator will use objects of this type to create the files containing the generated Swift code.

…y the code generator.

Motivation:

The CodeRenderer needs to create objects of some type representing the files containing the
generated code. This type is SourceFile.

Modifications:

Implemented the SourceFile struct, containing a name as a String and the generated code as Data.

Result:

The Code Renderer can now be brought from the OpenAPI generator, as it will have an output type.
The code generator will use objects of this type to create the files containing the generated Swift code.

/// Representation of the file to be created by the code generator, that contains the
/// generated Swift source code.
public struct SourceFile: Sendable {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Hashable too

public var name: String

/// The generated code as a String.
public var sourceCode: String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit contents

@glbrntt glbrntt added the version/v2 Relates to v2 label Nov 27, 2023
@glbrntt glbrntt enabled auto-merge (squash) November 27, 2023 16:27
@glbrntt glbrntt merged commit f88a9c0 into grpc:main Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version/v2 Relates to v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants