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

Render errors and warnings #333

Open
razor-x opened this issue Sep 9, 2024 · 5 comments
Open

Render errors and warnings #333

razor-x opened this issue Sep 9, 2024 · 5 comments

Comments

@razor-x
Copy link
Contributor

razor-x commented Sep 9, 2024

We will have separate errors and warnings sections that are children of the resource and look similar to the props section.

@DebbieAtSeam
Copy link
Contributor

DebbieAtSeam commented Sep 9, 2024

How about something like this?

# `acs_system`

Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).

## Properties

### `acs_system_id`

Format: `ID`

ID of the `acs_system`.

---

# Endpoints

## [`/acs/systems/get`](./get.md)

Returns a specified [access control system](https://docs.seam.co/latest/capability-guides/access-systems).

---

# Events

## `Event 1`

Event 1 description.

<details>

<summary>Event 1 Properties</summary>

### `event1prop1`

Format: `format`

Event 1 prop 1 description.

</details>

---

# Errors

## `Error 1`

Error 1 description.

---

# Warnings

## `Warning 1`

Warning 1 description.

---

Question 1: How do we show the format of the errors and warnings? I'm assuming that they're all based on the same error and warning objects, so all errors should have the same set of props, and all warnings should have the same set of props. Is that correct? Is there a way in which we could link to a definition of the error object and the warning object instead of repeating the same prop descriptions over and over again?

Question 2: Right now, Events is an H1, at the same level as the resource. If events, errors, and warnings are specifically linked to the resource (not the route), should we shift all the heading levels down one for events, errors, and warnings?

# `acs_system`

Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).

## Properties

### `acs_system_id`

Format: `ID`

ID of the `acs_system`.

---

## Events

### `Event 1`

Event 1 description.

<details>

<summary>Event 1 Properties</summary>

#### `event1prop1`

Format: `format`

Event 1 prop 1 description.

</details>

---

## Errors

### `Error 1`

Error 1 description.

---

## Warnings

### `Warning 1`

Warning 1 description.

---

# Endpoints

## [`/acs/systems/get`](./get.md)

Returns a specified [access control system](https://docs.seam.co/latest/capability-guides/access-systems).

---

@razor-x
Copy link
Contributor Author

razor-x commented Sep 9, 2024

all errors should have the same set of props, and all warnings should have the same set of props. Is that correct?

Mostly, however now that we can document and type these, I'd like errors and warnings to have more helpful props. Some already do, e.g., we have devices_connected_to_other_account with a device_ids prop.

@razor-x
Copy link
Contributor Author

razor-x commented Sep 9, 2024

I'd say Events are linked to the route, since we have lock.unlocked for example. We could document lock.unlocked under /devices device resource, but it would make more send to consider that event under /locks.

@andrii-balitskyi
Copy link
Contributor

andrii-balitskyi commented Sep 17, 2024

@razor-x, am I correct in understanding that rendering errors/warnings currently cannot be supported since they are not properly documented on seam-connect?
Most error/warning schemas are defined something like this:

z.array(
  z.object({
    error_code: z.string(),
    message: z.string(),
  })
)

@razor-x
Copy link
Contributor Author

razor-x commented Sep 18, 2024

@andrii-balitskyi Yes, but they should be properly typed for a acs_system and acs_user. All errors and warnings will be getting proper types. Let's just render the ones that have the types, and have the docsgen just render something generic for the ones that are not.

So this issue it not blocked, the next step is an example PR just like this one (or an update to blueprint if needed first): #338

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

3 participants