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

Creating derived model breaks when the schema has no title. #1271

Closed
Tracked by #1266
darrelmiller opened this issue Feb 27, 2022 · 0 comments · Fixed by #1381
Closed
Tracked by #1266

Creating derived model breaks when the schema has no title. #1271

darrelmiller opened this issue Feb 27, 2022 · 0 comments · Fixed by #1381
Assignees
Labels
fixed generator Issues or improvements relater to generation capabilities. type:bug A broken experience

Comments

@darrelmiller
Copy link
Member

The EndsWith method fails when title is null.

if(parentSchema.Reference?.Id?.EndsWith(title, StringComparison.OrdinalIgnoreCase) ?? false) return parentSchema.Reference.Id;
if(parentSchema.Items?.Reference?.Id?.EndsWith(title, StringComparison.OrdinalIgnoreCase) ?? false) return parentSchema.Items.Reference.Id;

    baseObject:
      type: object
      discriminator:
        propertyName: kind
      properties:
        name: { type: string }
        kind: { type: string }
    derivedObject:
      allOf:
      - $ref: "#/components/schemas/baseObject"
      - type: object
        properties:
          special: { type: string }
@baywet baywet self-assigned this Feb 28, 2022
@baywet baywet added the type:bug A broken experience label Feb 28, 2022
@baywet baywet moved this to Todo in Kiota Feb 28, 2022
@baywet baywet added this to Kiota Feb 28, 2022
@baywet baywet added this to the Community Preview milestone Feb 28, 2022
@baywet baywet added the generator Issues or improvements relater to generation capabilities. label Feb 28, 2022
@baywet baywet moved this from Todo to In Progress in Kiota Mar 14, 2022
@baywet baywet added the fixed label Mar 15, 2022
Repository owner moved this from In Progress to Done in Kiota Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed generator Issues or improvements relater to generation capabilities. type:bug A broken experience
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants