Skip to content

Skipping maligned check on a struct #860

Closed
@bentcoder

Description

@bentcoder

Hi,

I am wondering if I can explicitly skip running maligned check on any given struct rather than globally checking either all or none?

Regards

This is how I wish to return JSON response

{
   "id": 1,
   "name": "hello",
   "is_active": true,
   "created_at": "2019-01-01"
}
struct{
	ID       	uint16
	Name     	string
	IsActive 	bool
	CreatedAt	string
}

However, it is not possible because struct is not maligned and I have to malign it and the response looks odd.

struct{
	Name     	string
	CreatedAt	string
	ID       	uint16
	IsActive 	bool
}
{
   "name": "hello",
   "created_at": "2019-01-01",
   "id": 1,
   "is_active": true
}

Some annotation solution like this, maybe!

// @skip: maligned
struct{
	ID       	uint16
	Name     	string
	IsActive 	bool
	CreatedAt	string
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions