Skip to content

Library incorrectly throws "You supplied metadata and/or body data for this operation but it doesn't have any documented parameters or request payloads." #698

Closed

Description

@Naxdy

When referring to a spec that has parameters: [] but requestBody: { ... } set for some endpoint, the library incorrectly throws the exception

You supplied metadata and/or body data for this operation but it doesn't have any documented parameters or request payloads.

because the endpoint doesn't accept any parameters (but it does accept a request body!).

Activity

  1. added
    bug
    on Aug 18, 2023
  2. erunion commented on Aug 18, 2023

    @erunion
    Member

    Do you have an example API definition and code snippet this is happening on?

  3. added
    help wanted
    on Aug 23, 2023
  4. jahvi commented on Oct 18, 2023

    @jahvi

    @erunion I think I just ran into this issue, my getGames endpoint can take search and tagIds query params and nothing else:

    const GetGames = {"metadata":{"allOf":[{"type":"object","properties":{"tagIds":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"A comma separated string of tag ids associated with games."},"search":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"A search term used to search games with matching names."}},"required":[]}]},"response":{"200":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"submitterId":{"type":"string","description":"This field has not had a description added."},"ownerId":{"type":"string","description":"This field has not had a description added."},"iconImageAssetId":{"type":"string","description":"This field has not had a description added."},"featuredImageAssetId":{"type":"string","description":"This field has not had a description added."},"galleryMediaAssetIds":{"type":"object","description":"This field has not had a description added.","additionalProperties":true},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"host":{"type":"string","description":"This field has not had a description added."},"region":{"type":"string","description":"This field has not had a description added."},"type":{"type":"string","description":"This field has not had a description added."},"websiteUrl":{"type":"string","description":"This field has not had a description added."},"discordUrl":{"type":"string","description":"This field has not had a description added."},"twitterUrl":{"type":"string","description":"This field has not had a description added."},"isPublished":{"type":"boolean","description":"This field has not had a description added."},"isVerified":{"type":"boolean","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."},"iconImageAsset":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"s3Url":{"type":"string","description":"This field has not had a description added."},"cdnUrl":{"type":"string","description":"This field has not had a description added."},"mime":{"type":"string","description":"This field has not had a description added."},"extension":{"type":"string","description":"This field has not had a description added."},"checksum":{"type":"string","description":"This field has not had a description added."},"size":{"type":"integer","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"featuredImageAsset":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"s3Url":{"type":"string","description":"This field has not had a description added."},"cdnUrl":{"type":"string","description":"This field has not had a description added."},"mime":{"type":"string","description":"This field has not had a description added."},"extension":{"type":"string","description":"This field has not had a description added."},"checksum":{"type":"string","description":"This field has not had a description added."},"size":{"type":"integer","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}}},"slugs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"gameId":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}}}}},"$schema":"http://json-schema.org/draft-04/schema#"},"400":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#"}}} as const

    Code snippet:

    await api.getGames({
      tagIds: "ce6e103e-b120-43cb-9ab5-269fea747b75",
    });

    API
    npx api instal @hytopia-api-internal/v1.0#2mwi1plnuwhb87

    Let me know if there's anything else I can provide to help debug it.

  5. erunion commented on Oct 18, 2023

    @erunion
    Member

    @jahvi Well the good news is that I can't replicate that in our upcoming v7 release.

    import api from '@api/hytopia-api-internal';
    
    const { data } = await api.getGames({
      tagIds: 'ce6e103e-b120-43cb-9ab5-269fea747b75',
    });
    
    console.log(data);

    Screen Shot 2023-10-18 at 11 48 01 AM

    I'm hoping to get v7 out sometime next week.

  6. jahvi commented on Oct 18, 2023

    @jahvi

    That's good to know, is there a way to install the v7 alpha version in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions