Skip to content

Commit

Permalink
private/apigen,satellite/console: fix console generated API
Browse files Browse the repository at this point in the history
Update api generator and console type definitions so that the console
generated API can be regenerated without errors.

This change does not include a test to ensure that breaking changes do
not get merged, but that will be included in a following change.

https: //github.com//issues/6678

Change-Id: I130947340b7419547e88ce7e634b180acb458c2e
  • Loading branch information
mobyvb authored and Storj Robot committed Jan 10, 2024
1 parent a8bc92d commit 5effb82
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions private/apigen/tstypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ func GetClassFieldsFromStruct(t reflect.Type) []ClassField {
panic(err)
}

if jsonInfo.Skip {
continue
}

if !ok && !field.Anonymous {
panic(
fmt.Sprintf(
Expand Down Expand Up @@ -294,10 +298,6 @@ func GetClassFieldsFromStruct(t reflect.Type) []ClassField {

fieldNames[jsonInfo.FieldName] = struct{}{}

if jsonInfo.Skip {
continue
}

fields = append(
fields,
ClassField{
Expand Down
4 changes: 2 additions & 2 deletions satellite/console/apikeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ type APIKeyInfo struct {
Secret []byte `json:"-"`
CreatedAt time.Time `json:"createdAt"`

ProjectRateLimit *int
ProjectBurstLimit *int
ProjectRateLimit *int `json:"-"`
ProjectBurstLimit *int `json:"-"`
}

// APIKeyCursor holds info for api keys cursor pagination.
Expand Down
5 changes: 4 additions & 1 deletion satellite/console/consoleweb/consoleapi/apidocs.gen.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API Docs

**Description: **Interacts with projects
**Description:** Interacts with projects

**Version:** `v0`

Expand Down Expand Up @@ -60,6 +60,7 @@ Creates new Project with given info
userSpecifiedBandwidthLimit: string // Amount of memory formatted as `15 GB`
segmentLimit: number
defaultPlacement: number
defaultVersioning: number
}

```
Expand Down Expand Up @@ -110,6 +111,7 @@ Updates project with given info
userSpecifiedBandwidthLimit: string // Amount of memory formatted as `15 GB`
segmentLimit: number
defaultPlacement: number
defaultVersioning: number
}

```
Expand Down Expand Up @@ -154,6 +156,7 @@ Gets all projects user has
userSpecifiedBandwidthLimit: string // Amount of memory formatted as `15 GB`
segmentLimit: number
defaultPlacement: number
defaultVersioning: number
}

]
Expand Down
1 change: 1 addition & 0 deletions web/satellite/src/api/v0.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class Project {
userSpecifiedBandwidthLimit: MemorySize | null;
segmentLimit: number | null;
defaultPlacement: number;
defaultVersioning: number;
}

export class ResponseUser {
Expand Down

0 comments on commit 5effb82

Please sign in to comment.