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

Ref for maps object does not get created #42

Open
Keithwachira opened this issue May 6, 2024 · 0 comments
Open

Ref for maps object does not get created #42

Keithwachira opened this issue May 6, 2024 · 0 comments

Comments

@Keithwachira
Copy link

Keithwachira commented May 6, 2024

If you have a struct that has map with struct values, the swagger generated does not reference the AccessDefinition.

type Policys struct {	
AccessRights                  map[string]AccessDefinitions      `bson:"access_rights" json:"access_rights"`
}

type AccessDefinitions struct {
	Name string `json:"name"`
}

This is what is produced instead of using ref to reference the already created AccessDefinitions :

  schemas:
    AccessDefinitions:
      properties:
        name:
          type: string
      type: object
    Policys:
      properties:
        access_rights:
          properties:
            key:
              properties:
                name:
                  type: string
              type: object
          type: object
      type: object ```

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

1 participant