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

bug: Overriding Optional between Generic and Node crash server #4936

Closed
BeArchiTek opened this issue Nov 14, 2024 · 0 comments · Fixed by #4940
Closed

bug: Overriding Optional between Generic and Node crash server #4936

BeArchiTek opened this issue Nov 14, 2024 · 0 comments · Fixed by #4940
Assignees
Labels
type/bug Something isn't working as expected

Comments

@BeArchiTek
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

1.0.4

Current Behavior

When loading a schema and having the same attribute in both the Generic and the node inheriting from it, it's possible to load the schema, BUT if the optional data of the attribute changes, the server will loop on the TypeError.

Expected Behavior

Schema should be refuse if the inherited: true is not present

Steps to Reproduce

  1. Start infrahub 1.0.4 and load this schema :
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'

generics:
  - name: Sandwich
    namespace: Meal
    attributes:
      - name: description
        kind: Text
        optional: false

nodes:
  - name: Grilled
    namespace: Sandwich
    inherit_from:
      - MealSandwich
    attributes:
      - name: description
        kind: Text
        optional: true
  1. Check the log of the server, you should see
2024-11-14 14:56:04 TypeError: Interface field MealSandwich.description expects type TextAttribute! but 
2024-11-14 14:56:04 SandwichGrilled.description is type TextAttribute.

Additional Information

No response

@BeArchiTek BeArchiTek added the type/bug Something isn't working as expected label Nov 14, 2024
@gmazoyer gmazoyer self-assigned this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants