Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Strip parent name of enum cases within nested objects#15

Merged
kean merged 1 commit intoCreateAPI:mainCreateAPI/CreateAPI:mainfrom
PhilipTrauner:strip-parent-name-in-nested-objectsPhilipTrauner/CreateAPI:strip-parent-name-in-nested-objectsCopy head branch name to clipboard
Feb 3, 2022
Merged

Strip parent name of enum cases within nested objects#15
kean merged 1 commit intoCreateAPI:mainCreateAPI/CreateAPI:mainfrom
PhilipTrauner:strip-parent-name-in-nested-objectsPhilipTrauner/CreateAPI:strip-parent-name-in-nested-objectsCopy head branch name to clipboard

Conversation

@PhilipTrauner
Copy link
Contributor

Strips the parent name of enum cases within objects that are oneOf / allOf / anyOf of nested references.

Given:

Parent
├── ParentA
└── ParentB

Disabled:

public enum Parent: Codable {
    case parentA(ParentA)
    case parentB(ParentB)
}

Enabled:

public enum Parent: Codable {
    case a(ParentA)
    case b(ParentB)
}

This is primarily useful for union types.

@kean
Copy link
Member

kean commented Feb 3, 2022

That's brilliant. That's exactly the kind of features I think CreateAPI should have.

@kean kean merged commit 303aeca into CreateAPI:main Feb 3, 2022
@PhilipTrauner PhilipTrauner deleted the strip-parent-name-in-nested-objects branch February 3, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.