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

Generated code contains obviously generated names 'PossibleGet0ItemsItemValues' #666

Closed
chamons opened this issue Jul 28, 2021 · 2 comments

Comments

@chamons
Copy link
Contributor

chamons commented Jul 28, 2021

Steps to Reproduce:

This is a subset of app configuration's current stable swagger.

Result:

type Get0ItemsItem string

const (
	Get0ItemsItemContentType Get0ItemsItem = "content_type"
	Get0ItemsItemEtag Get0ItemsItem = "etag"
	Get0ItemsItemKey Get0ItemsItem = "key"
	Get0ItemsItemLabel Get0ItemsItem = "label"
	Get0ItemsItemLastModified Get0ItemsItem = "last_modified"
	Get0ItemsItemLocked Get0ItemsItem = "locked"
	Get0ItemsItemTags Get0ItemsItem = "tags"
	Get0ItemsItemValue Get0ItemsItem = "value"
)

// PossibleGet0ItemsItemValues returns the possible values for the Get0ItemsItem const type.
func PossibleGet0ItemsItemValues() []Get0ItemsItem {
	return []Get0ItemsItem{	
		Get0ItemsItemContentType,
		Get0ItemsItemEtag,
		Get0ItemsItemKey,
		Get0ItemsItemLabel,
		Get0ItemsItemLastModified,
		Get0ItemsItemLocked,
		Get0ItemsItemTags,
		Get0ItemsItemValue,
	}
}

// ToPtr returns a *Get0ItemsItem pointing to the current value.
func (c Get0ItemsItem) ToPtr() *Get0ItemsItem {
	return &c
}

type Head0ItemsItem string

const (
	Head0ItemsItemContentType Head0ItemsItem = "content_type"
	Head0ItemsItemEtag Head0ItemsItem = "etag"
	Head0ItemsItemKey Head0ItemsItem = "key"
	Head0ItemsItemLabel Head0ItemsItem = "label"
	Head0ItemsItemLastModified Head0ItemsItem = "last_modified"
	Head0ItemsItemLocked Head0ItemsItem = "locked"
	Head0ItemsItemTags Head0ItemsItem = "tags"
	Head0ItemsItemValue Head0ItemsItem = "value"
)

// PossibleHead0ItemsItemValues returns the possible values for the Head0ItemsItem const type.
func PossibleHead0ItemsItemValues() []Head0ItemsItem {
	return []Head0ItemsItem{	
		Head0ItemsItemContentType,
		Head0ItemsItemEtag,
		Head0ItemsItemKey,
		Head0ItemsItemLabel,
		Head0ItemsItemLastModified,
		Head0ItemsItemLocked,
		Head0ItemsItemTags,
		Head0ItemsItemValue,
	}
}

// ToPtr returns a *Head0ItemsItem pointing to the current value.
func (c Head0ItemsItem) ToPtr() *Head0ItemsItem {
	return &c
}
@chamons
Copy link
Contributor Author

chamons commented Jul 28, 2021

If you generate the full swagger, you'll get names like PossibleEnum4Values and Enum5ContentType.

@jhendrixMSFT
Copy link
Member

This is an artifact of M4 behavior, we can't (at the code generator level) control this.

It's part of a larger conversation about enum definitions omitting x-ms-enum annotations. See here for some of that conversation.

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