Skip to content

May all responses fields should be marked as required? #15

@sneko

Description

@sneko

Hi @emnbdx ,

I'm generating a client for TypeScript from https://raw.githubusercontent.com/HelloAsso/helloasso-open-api/refs/heads/main/helloasso.json but all the nested fields are marked as optional (undefined). So for example for a nullable string it's string | null | undefined, and for a string string | undefined.

I saw for model HelloAsso.Api.V5.Models.OrganizationLegalInformations.UpdateOrganizationLegalInformationConfigurationBody you put the required OpenAPI property to avoid this.

I'm wondering if required should be on all models (even those for wrapping the responses because they get data/pagination optionals too).

Thank you,

EDIT: in case you want to debug this, here a simple TS script to generate all fields and then to try importing for example getOrganizationsByOrganizationSlugOrders:

import { createClient } from '@hey-api/openapi-ts';

createClient({
  input: 'https://raw.githubusercontent.com/HelloAsso/helloasso-open-api/refs/heads/main/helloasso.json',
  output: 'helloasso',
  plugins: ['@hey-api/client-fetch'],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions