Skip to content

no methods member in Components Object #389

Open

Description

@aatifsyed

OpenRPC.methods: [Method | Reference]:

spec/spec.md

Line 113 in 0e08a5c

<a name="openrpc-methods"></a>methods | [[Method Object](#method-object) \| [Reference Object](#reference-object)] | **REQUIRED**. The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example).

but there is no methods member:

spec/spec.md

Lines 310 to 323 in 0e08a5c

## Components Object
Holds a set of reusable objects for different aspects of the OpenRPC.
All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
Field Name | Type | Description
---|:---|---
<a name="components-content-descriptors"></a>contentDescriptors | Map[`string`, [Content Descriptor Object](#content-descriptor-object)] | An object to hold reusable [Content Descriptor Objects](#content-descriptor-object).
<a name="components-schemas"></a>schemas | Map[`string`, [Schema Object](#schema-object)] | An object to hold reusable [Schema Objects](#schema-object).
<a name="components-examples"></a>examples | Map[`string`, [Example Object](#example-object)] | An object to hold reusable [Example Objects](#example-object).
<a name="components-links"></a> links | Map[`string`, [Link Object](#link-object)] | An object to hold reusable [Link Objects](#link-object).
<a name="components-errors"></a>errors | Map[`string`, [Error Object](#error-object)] | An object to hold reusable [Error Objects](#error-object).
<a name="components-example-pairing-objects"></a>examplePairingObjects | Map[`string`, [Example Pairing Object](#example-pairing-object)] | An object to hold reusable [Example Pairing Objects](#example-pairing-object).
<a name="components-tags"></a>tags | Map[`string`, [Tag Object](#tag-object)] | An object to hold reusable [Tag Objects](#tag-object).

Activity

  1. github-actions commented on Jun 10, 2024

    @github-actions

    Welcome to OpenRPC! Thank you for taking the time to create an issue. Please review the guidelines

  2. aatifsyed commented on Jun 11, 2024

    @aatifsyed
    Author

    Relevant comment: #339 (comment)

  3. aatifsyed commented on Jun 11, 2024

    @aatifsyed
    Author

    Possible that this shouldn't be allowed, since it'd allow you to trivially create duplicate methods, and if not, then... why have them in components?

  4. zcstarr commented on Jul 27, 2025

    @zcstarr
    Member

    I think this would be a thing for the new linter we've been working on as a case which would be a no-duplicates , I think spec reference just makes everything easier once you have larger spec, but cautions make sense . @shanejonas looping for a feature for the linter.

    Otherwise I'm not sure why we wouldn't support refs

  5. aatifsyed commented on Jul 28, 2025

    @aatifsyed
    Author

    To clarify, what I mean is that the components object itself doesn't support methods. That is, if I had a Method to stick in the components object, there is nowhere for me to put it

  6. zcstarr commented on Aug 8, 2025

    @zcstarr
    Member

    Yeah I think the question is when would you share or reuse a method component? Is it mostly centered around a notion of completeness ?

  7. aatifsyed commented on Aug 8, 2025

    @aatifsyed
    Author

    Yeah I think the question is when would you share or reuse a method component? Is it mostly centered around a notion of completeness ?

    You'll have to ask the authors of the spec, since it's spec wording, not mine :)

    The fix is either:

    - OpenRPC.methods: [Method | Reference]
    + OpenRPC.methods: [Method]

    or

    + OpenRPC.components.methods: Map[string, Method]
  8. aatifsyed commented on Aug 8, 2025

    @aatifsyed
    Author

    Relevant comment: #339 (comment)


    Yeah I think the question is when would you share or reuse a method component? Is it mostly centered around a notion of completeness ?

    You'll have to ask the authors of the spec, since it's spec wording, not mine :)


    @BelfordZ in case you want to weigh in

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions