Comparing 1.7.2...1.8.0 · apple/swift-openapi-generator (original) (raw)
Commits on Apr 8, 2025
Commits on Apr 9, 2025
Motivation
The streaming ChatGPT example we have uses Swift 6.0 and the Swift VS
Code extension from the SSWG. Since then, Swift 6.1 has been released,
which contains fixes for indexing and editor functionality for code
generated by Swift package plugins. The VS Code plugin has also been
moved to the Swift project.
Modifications
- Update the example dev container to Swift 6.1.
- Update the example dev container to use
swiftlang.swift-vscode
. - Clean up redundant workarounds in VS Code settings.
- Link to try! Swift in addition to FOSDEM for folks looking for
reference sources from conference talk.
Result
Example represents what was most recently presented.
Test Plan
CI will ensure the package has not regressed.
Configuration menu
Browse the repository at this point in the history
Commits on Apr 14, 2025
- Enable Swift 6.1 jobs in CI (#761)
Motivation:
Swift 6.1 has been released, we should add it to our CI coverage.
Modifications:
Add additional Swift 6.1 jobs where appropriate in main.yml,
pull_request.yml
Result:
Improved test coverage.
rnro authored
Apr 14, 2025
Configuration menu
Browse the repository at this point in the history
Commits on Apr 16, 2025
Commits on May 7, 2025
- Drop Swift 5.9 (#765)
Motivation:
Swift 5.9 is no longer supported, we should bump the tools version and
remove it from our CI.
Modifications:
- Bump the Swift tools version to Swift 5.10
- Remove Swift 5.9 jobs where appropriate in main.yml, pull_request.yml
Result:
Code reflects our support window.
rnro authored
May 7, 2025
Configuration menu
Browse the repository at this point in the history
Commits on May 21, 2025
Commits on May 23, 2025
Motivation
Users want the ability to add custom comments to generated files. One
concrete use case is adding directives like swift-format-ignore-file
and swiftlint:disable all
to prevent these tools from processing
generated code.
Modifications
- Added
additionalFileComments
property toConfig
andUserConfig
structs - Modified
FileTranslator
to include additional comments along with
the do-not-edit comment - Added CLI support with
--additional-file-comment
option - Added config tests to confirm the option propagates and the default is
empty - Added snippet tests to validate the actual rendering
- Updated documentation with examples and usage instructions
Result
Users can now configure additional comments to be added to generated
files using either the config file or a command line option.
Fixes #738.
Test plan
- Added unit tests for
Config
- Added snippet tests for rendering
- Manual tests of generator using config and CLI on real OpenAPI doc:
% swift run swift-openapi-generator generate openapi-documents/petstore.yaml \
--mode types \
--output-directory test-output-cli \
--additional-file-comment "hello world" \
--additional-file-comment "testing, testing, 1, 2, 3"
Build of product 'swift-openapi-generator' complete! (3.27s)
Swift OpenAPI Generator is running with the following configuration:
- OpenAPI document path: /Users/Si/work/code/swift-openapi-workspace/packages/swift-openapi-generator/openapi-documents/petstore.yaml
- Configuration path: <none>
- Generator modes: types
- Access modifier: internal
- Naming strategy: defensive
- Name overrides: <none>
- Feature flags: <none>
- Output file names: Types.swift
- Output directory: /Users/Si/work/code/swift-openapi-workspace/packages/swift-openapi-generator/test-output-cli
- Diagnostics output path: <none - logs to stderr>
- Current directory: /Users/Si/work/code/swift-openapi-workspace/packages/swift-openapi-generator
- Plugin source: <none>
- Is dry run: false
- Additional imports: <none>
- Additional file comments: hello world, testing, testing, 1, 2, 3
Writing data to file Types.swift...
% head -5 test-output-cli/Types.swift
// Generated by swift-openapi-generator, do not modify.
// hello world
// testing, testing, 1, 2, 3
@_spi(Generated) import OpenAPIRuntime
Configuration menu
Browse the repository at this point in the history