Giter Site home page Giter Site logo

Comments (6)

mrlubos avatar mrlubos commented on July 20, 2024

Hey, can you share your config, which version you're on, and OpenAPI spec?

from openapi-ts.

WildEgo avatar WildEgo commented on July 20, 2024

Hey, can you share your config, which version you're on, and OpenAPI spec?

Version should be 0.45.1, the config is below

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

export default defineConfig({
  client: 'fetch',
  input: '../dashboard/api.json',
  output: {
    format: false,
    lint: false,
    path: 'src/client',
  },
  types: {
    enums: 'typescript',
  },
});

from openapi-ts.

mrlubos avatar mrlubos commented on July 20, 2024

I assume the same happens with the latest version? Can you share your OpenAPI spec?

from openapi-ts.

WildEgo avatar WildEgo commented on July 20, 2024

I assume the same happens with the latest version? Can you share your OpenAPI spec?

Yes it does happen on 0.46.2, I can provide the spec but it's not gonna do much for this specifically this is the part that is probably causing the issue, I should add that it generates the code below, I'll also add an expected behaviour

        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "{}"
                }
              }
            }
          }
        },

Generates:

export type StoreRequestData = {
    acceptLanguage?: string;
    formData?: {
        [key: string]: ();
    };
    service: string;
};

I'd expect it to be

export type StoreRequestData = {
    acceptLanguage?: string;
    formData?: {
        [key: string]: unknown;
    };
    service: string;
};

from openapi-ts.

mrlubos avatar mrlubos commented on July 20, 2024

Great, thanks! And what does your payload passed to form data look like?

from openapi-ts.

WildEgo avatar WildEgo commented on July 20, 2024

Great, thanks! And what does your payload passed to form data look like?

It's a simple structure, there's no depth, some values are string, some are Date some are File, I haven't had a look at the files, I'll have to see if they work or not

from openapi-ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.