Skip to content

Non-deterministic ordering security scheme provider constants #310

@alicecarlotti

Description

@alicecarlotti

Currently the the order of security scheme providers constants is not deterministic (e.g. as in the generated code snippet below). This is because the order is determined by iterating over a map, which is deliberately randomized in Go.

const (
	TokenAuthScopes = "TokenAuth.Scopes"
	BasicAuthScopes = "BasicAuth.Scopes"
	JWTAuthScopes   = "JWTAuth.Scopes"
)

We currently check for changes to the generated files to determine whether additional steps are needed in our CI workflow. This non-deterministic behaviour is causing frequent false positives in our api change detection, which unnecessarily interrupts our CI workflow.

I've created a fix for this issue.

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