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

Group interfaces don't match documentation #241

Closed
alukach opened this issue Jul 11, 2018 · 2 comments
Closed

Group interfaces don't match documentation #241

alukach opened this issue Jul 11, 2018 · 2 comments
Assignees

Comments

@alukach
Copy link
Contributor

alukach commented Jul 11, 2018

Taking a look at our IGroup interface, it doesn't seem to match the documentation at all:

export interface IGroup {
id?: string;
owner: string;
title: string;
tags: string[];
description?: string;
categories?: string[];
culture?: string;
[key: string]: any;
}

For example, it shows owner as a required parameter however the docs do not show it as a supported parameter and states:

The user who creates the group automatically becomes the owner of the group.

Furthermore, parameters like culture and categories are not related to the Group objects at all and appear to be likely copied over from the parameters for creating Item instances.

My understanding is that the interfaces should be updated to something similar to the following:

export interface IGroupCreateRequest {
  title: string;
  access: 'private' | 'org' | 'public';
  description?: string;
  snippet?: string;
  tags?: string;
  phone?: string;
  sortField?: 'title' | 'owner' | 'avgrating' | 'numviews' | 'created' | 'modified';
  sortOrder?: 'asc' | 'desc';
  isViewOnly?: boolean;
  isInvitationOnly?: boolean;
  thumbnail?: string;
  autoJoin?: boolean;
}

// https://developers.arcgis.com/rest/users-groups-and-items/group.htm
export interface IGroup {
  title: string;
  id: string;
  isInvitationOnly: boolean;
  owner: string;
  description?: string;
  snippet?: string;
  tags: string[];
  phone?: string;
  sortField?: 'title' | 'owner' | 'avgrating' | 'numviews' | 'created' | 'modified';
  sortOrder?: 'asc' | 'desc';
  isViewOnly: boolean;
  isFav: boolean;
  thumbnail?: string;
  created: number;
  modified: number;
  access: 'private' | 'org' | 'public';
  protected: boolean;
  autoJoin: boolean;
  // Server responded with the following undocumented attributes:
  // "isReadOnly": false,
  // "capabilities": [],
  // "provider": null,
  // "providerGroupName": null,
}

export interface IGroupCreateResponse {
  success: boolean;
  group: IGroup;
}

Having separate interfaces for the Request and Response parameters would make development go much more smoothly.

@jgravois jgravois self-assigned this Jul 13, 2018
@jgravois
Copy link
Contributor

thanks for taking the time to write up this feedback @alukach!

i just opened #244 to try and address the problem. if you have time to give it a quick review, it'd be sincerely appreciated.

jgravois added a commit that referenced this issue Jul 18, 2018
…and differentiate it from a res

AFFECTS PACKAGES:
@esri/arcgis-rest-common-types
@esri/arcgis-rest-groups

ISSUES CLOSED: #241
@jgravois jgravois reopened this Jul 19, 2018
@jgravois
Copy link
Contributor

took another pass at this in #248. Updated interfaces are IGroupAdd (for requests to create a new group) and IGroup (which represents an existing group).

thanks again for the feedback and follow up dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants