apple / apple/swift-openapi-generator

Support default values for schema properties

Open
#66 3 comments 0 reactions 0 assignees View on GitHub
area/generator area/openapi size/M
Dominant language
Swift
Stars
2k
Forks
182
Avg merge
13h 28m
Merged PRs (30d)
5

Description

The generator skips the default values for Components.Schemas. It would be nice to have a default value for the property itself and in the initializer. I made an example:

Spec example:
Screenshot 2023-06-13 at 20 22 25

Current:
Screenshot 2023-06-13 at 20 20 58

Desired:
Screenshot 2023-06-13 at 20 21 52

Contributor guide

Open the contributing guide

Research direction

Start at the generator entry point for Components.Schemas and compare the linked Spec example with the Current and Desired outputs. Trace how schema property values become generated declarations and initializers; done means schema defaults appear in both places as shown in the Desired example.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, swift
Domain
backend-api-design, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.