Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable, unique names for anonymous OneOf schemas #91

Closed
Tomboyo opened this issue Aug 9, 2023 · 1 comment
Closed

Stable, unique names for anonymous OneOf schemas #91

Tomboyo opened this issue Aug 9, 2023 · 1 comment

Comments

@Tomboyo
Copy link
Owner

Tomboyo commented Aug 9, 2023

Given a OneOf schema with anonymous (in-line) schemas in it like the following,

Foo:
  oneOf:
    - type: object
      properties:
        a: ...
    - type: object
      properties:
        b: ...
    

we generate objects named Foo1 and Foo2 in the same package as Foo (per sealed interface rules about packages -v- Java 9 modules). If the order of those two elements changes in a subsequent release of the OAS, then existing code will break: Lily will still generate objects named Foo1 and Foo2, but Foo1 will have property b, not a.

Consider implementing some kind of hash-like function which produces no collisions and is not dependent on element order so that we can create unique names for anonymous schemas that work between releases of the OAS and do not cause name collisions.

@Tomboyo Tomboyo added this to the Compositional Types milestone Aug 9, 2023
@Tomboyo
Copy link
Owner Author

Tomboyo commented Oct 19, 2023

Closing as out of date with ADR 0002

@Tomboyo Tomboyo closed this as completed Oct 19, 2023
@Tomboyo Tomboyo reopened this Oct 19, 2023
@Tomboyo Tomboyo closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant