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

Optimization - reusable components for orderby/expand/select query parameters #612

Open
baywet opened this issue Nov 28, 2024 · 3 comments
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience.

Comments

@baywet
Copy link
Member

baywet commented Nov 28, 2024

Since #197 was implemented through #499, we have a big opportunity to make descriptions much smaller.

Effectively all operations now have the same definition for those query parameters when they support it

        - name: $orderby
          in: query
          description: Order items by property values
          style: form
          explode: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: $select
          in: query
          description: Select properties to be returned
          style: form
          explode: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: $expand
          in: query
          description: Expand related entities
          style: form
          explode: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string

When the setting it on, we should do the same thing we do for count/top/skip/filter... and have instead

 - $ref: '#/components/parameters/expand'
 - $ref: '#/components/parameters/select'
 - $ref: '#/components/parameters/orderby'

Which would save a ton of repetition throughout the final description.

@baywet baywet added priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience. labels Nov 28, 2024
@darrelmiller
Copy link
Member

I would request that we do not do this. This will cause us to lose the valuable information of which properties can be sorted, expanded and filtered.

@baywet
Copy link
Member Author

baywet commented Nov 28, 2024

@darrelmiller the component aspect would only happen when the UseStringArrayForQueryOptionsSchema conversion setting added in #499 is set to true, where the enum values are already gone, so this change would not "loose any more information". It would not happen when the setting is false. In which case we maintain the enum values.

@darrelmiller
Copy link
Member

Fine. We can defer the fight to choosing what value we should use for UseStringArrayForQueryOptionsSchema :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience.
Projects
None yet
Development

No branches or pull requests

2 participants