You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Thanks for filing it – you're right, default values are not generated at the moment, but it's a feature we'd like to do, and would gladly accept a pull request for 🙂 Let me slightly rename and label this issue, to properly track it.
Activity
czechboy0 commentedon Jun 13, 2023
Thanks for filing it – you're right, default values are not generated at the moment, but it's a feature we'd like to do, and would gladly accept a pull request for 🙂 Let me slightly rename and label this issue, to properly track it.
A good starting point for anyone contributing this feature would be to add the default value to https://github.com/apple/swift-openapi-generator/blob/main/Sources/_OpenAPIGeneratorCore/Translator/CommonTranslations/translateObjectStruct.swift#L62, and work from there.
[-]There is no default values for components.[/-][+]Support default values for struct properties[/+][-]Support default values for struct properties[/-][+]Support default values for schema properties[/+]PARAIPAN9 commentedon Sep 10, 2024
Hi, I would like to express my intention to work on this issue, if it is still available. Please let me know if I can proceed.
czechboy0 commentedon Sep 10, 2024
Go ahead!