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

Resolve relations to referenced resources when references follow a na… #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phfeustel
Copy link
Contributor

…ming convention.

Example: A theater play has serveral character roles. When creating or updating a role resource I want to include the back reference from role to play also in the payload. But I don't want to send the whole play payload. To model this relation I set the playResourceId within the role resource.
I want this relation to be reflected also in my UML diagrams but cannot $ref the play resource in role because this would include the complete play resource JSON in role. That's why I just use the playResourceId.

To be able to reflect this relationship in the UML I propose to search for ResouceId in the format string endings of the referencing resource. If found, a relation between the referencing and the referenced resource (role and play) in this case is created.

  Play:
    type: object
    properties:
      id:
        type: string
        format: uuid
      title:
        type: string
  Role:
    type: object
    properties:
      id:
        type: string
        format: uuid
      title:
        type: string
      playId:
        type: string
        format: playResourceId

Creates:

class Play {
    {field} string (uuid) id
    {field} string title
}
class Role {
    {field} string (uuid) id
    {field} string title
    {field} string (playResourceId) playId
}

Role ..> Play

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.

1 participant