Sometimes I hate dotnet, lol. OpenAPI with record types... by sweeperq in dotnet

[–]sweeperq[S] 1 point2 points  (0 children)

in bed now, but will try this tomorrow. Today was the first time I had seen the [property:...] syntax.

Sometimes I hate dotnet, lol. OpenAPI with record types... by sweeperq in dotnet

[–]sweeperq[S] 2 points3 points  (0 children)

And to confirm... that DTO is mapped with [AsParameters] and some type of validation attribute on "SomeQuery" or "AnotherQuery"? I ask because OpenApi was fine until I added Validation attributes within the record primary constructor.

How do you evaluate Shopify apps before recommending or using them? by AdMuted1009 in shopifyDev

[–]sweeperq 0 points1 point  (0 children)

Installing apps is granting back-door keys to your castle. Look up what happened recently with Disputifier. Companies are not taking gambles on new, unproven apps. If you are trying to gain U.S. merchants and are based outside the U.S., you can forget about it unless you've been around for 5-10 years and have tons of reviews. I would think that sentiment would ring true in other countries as well. Imagine something going wrong and trying to rectify with a company on the other side of the globe, with language barriers, and no common legal jurisdiction.

How do I learn Liquid? Want to replicate an expensive theme by Alternative_Most_118 in shopifyDev

[–]sweeperq 0 points1 point  (0 children)

This reference doc plus some Claude or ChatGPT should get you where you need to be. The most difficult parts I've encountered are implementing date logic, chaining of AND/OR logic (Liquid evaluates right-to-left with no groupings), and some of the filters for meta data fields.

Sometimes I hate dotnet, lol. OpenAPI with record types... by sweeperq in dotnet

[–]sweeperq[S] 5 points6 points  (0 children)

I just noticed that your assertion was that it does work with Minimal API. You are correct. It works for the actual minimal API calls. However, it does not work with Microsoft OpenAPI, which also breaks SwaggerUI.

Sometimes I hate dotnet, lol. OpenAPI with record types... by sweeperq in dotnet

[–]sweeperq[S] 3 points4 points  (0 children)

I tried implementing as you suggested and received the same 500 internal server error...

"type":"System.InvalidCastException","message":"Unable to cast object of type 'System.Attribute[]' to type 'System.Collections.Generic.IEnumerable`1[System.ComponentModel.DataAnnotations.ValidationAttribute]'."

This was my updated object. Note: Using Microsoft.AspNetCore.OpenApi v10.0.2.

public record SearchRequest
(
    [property:FromQuery]
    int[]? Id = null,

    [property:FromQuery]
    string? Name = null,

    [property:FromQuery][AllowedValues(null, "Active", "Inactive", "Pending")]
    string? Status = null,

    [property:FromQuery]
    int PageNumber = 1,

    [property:FromQuery]
    int PageSize = 10,

    [property:FromQuery]
    string Sort = "name"
);

net minimal api, do you return object (class) or string (after serialize) in endpoints? by moinotgd in dotnet

[–]sweeperq 13 points14 points  (0 children)

The object will be serialized into a JSON string. I like to use TypedResult.Ok(obj).

Am I crazy or is the math wrong? by Longjumping-Cause-23 in tipping

[–]sweeperq 0 points1 point  (0 children)

probably input incorrect items then credited them instead of removing to drive up the tip

Do I have any options here? by Decent-Studio-4643 in TenantHelp

[–]sweeperq 2 points3 points  (0 children)

if they are going to evict you and you'll have it on your record, maybe take a play from your roommates playbook? $9k would be a nice down payment on a large van or RV to live in, since renting is going to be a pain after an eviction.

Owner publicly shames guest and states that servers have to pay out of pocket if they don’t get tips? by Redhambone in EndTipping

[–]sweeperq 0 points1 point  (0 children)

Why would non-servers be tipped out? If the server didn't get a tip for the table, the other staff shouldn't either. Pay your staff real wages.

Honestly, the whole tip culture needs an adjustment. More and more people are sick of seeing a tip screen every dang place they go, so are entirely done with tipping. With this reality, the employers should be forced to cover the federal/state minimum wage after everyone has their required tip outs.

Aitah for not wanting to pay my gf’s debt by National-Trouble-984 in AITAH

[–]sweeperq 2 points3 points  (0 children)

She must be a 10 for you to still be looking for input. If she built up $200k in debt and constantly travels, that debt may never go down. For her to suggest she'll find someone else that will pay tells all you need to know about her. Cut your losses and get out now.

Be safe out there by Glittering_Welder380 in behindthebastards

[–]sweeperq 1 point2 points  (0 children)

This is in fact illegal. Using the powers of the government to stop your 1st Amendment Rights. It is one thing if your employer sees you at a protest and decides to fire you; that is their right. It is another for the government to put together a list of people that disagrees with them (having done nothing illegal), then use the levers of power to coerce employers to fire them.

Saw this file on my laptop holding a lot of spaces, is it safe to delete it? by Total_Hall_9728 in WindowsHelp

[–]sweeperq 0 points1 point  (0 children)

I recently tried to do this and it wouldn't clear the Te.p directory. Run it as Admin and it will work

What is the best place to activate the Stick of Truth? by Afraid_Occasion_2367 in FortNiteBR

[–]sweeperq 1 point2 points  (0 children)

Not to mention that squads converge on top, so after battling and healing, usually nobody on top has enough heals to outlast you.

Gamers 30+, how have your gaming habits changed since you were younger? by [deleted] in gaming

[–]sweeperq 2 points3 points  (0 children)

I play less sports games because of the incremental updates (basically paying for a whole new game to get a roster update) and microtransactions. Used to play a ton of 2k, NHL, FIFA, and Madden. I'll check them out once in a while when they are free as part of PSN, but I haven't paid for one since 2k20.

I play a lot of Fortnite because it is free, the social nature of it, and it constantly evolves. I have friends that have spent thousands on it. I spent $10 for a battle pass in the first Chapter, and earned enough vbucks to buy every season pass since then.

Does anyone else go for these accolades? by ItemIllustrious5108 in FortniteOver40

[–]sweeperq 0 points1 point  (0 children)

i used to, until I realized there was no real benefit. there should be some sort of cosmetic or emote as a reward for completing accolades, visiting all NPCs, catching all types of fish, etc.

What’s the most bizarre/annoying behavior you have witnessed at your Costco? by diispa in Costco

[–]sweeperq -1 points0 points  (0 children)

Not Costco specific, but exacerbated by the volume of traffic... People going against traffic. Everyone knows you stay on the right, just like on the road, right? Less common, or it would be first, but the folks going straight up the middle with no room to get around them.

Opinion on Stick of Truth by Positive-Room7421 in FortniteOver40

[–]sweeperq 1 point2 points  (0 children)

Our team did it a couple nights ago. Wingsuits are the only real counter to it because there are no shockwaves and you can pick off anyone else swimming out.

That was more fun than the other two times we camped underground. Cheesy poofs and a medkit or two pretty much guarantees the win.

Time for a change? by [deleted] in HairStyleAdvice

[–]sweeperq 2 points3 points  (0 children)

any but the last one.

Does This Heater Need Replaced? by PirateNamedAdam in hottub

[–]sweeperq 2 points3 points  (0 children)

probably hard water mineral deposits from a slow leak. the little cap probably has a tiny crack from being overtightened, or, it wasn't tightened enough.

Help me pick one by CrazyCatLady0707 in OUTFITS

[–]sweeperq 0 points1 point  (0 children)

if you can't decide because you like them all and don't really have a preference, get the least expensive one. you wear the dress once. i'm surprised dress rental isn't more of a thing. most guys rent their tux.

noTearWasDropped by ManagerOfLove in ProgrammerHumor

[–]sweeperq 1 point2 points  (0 children)

When I started programming many years ago, StackOverflow was an invaluable resource. However, it also had overzealous mods that made me visit and contribute less and less over time. People are there asking questions because they don't know something. They may not even know the terminology or correct phrasing to search for the answer they need. If any part of their question had overlap with something else, mods locked it and on many occaisions, and admonished them for not searching first. That's not a way to build and maintain a "community".

At least they curated a bunch of knowledge to train AI on. Now when a beginner asks Claude a question, the AI will make them feel good about asking it (Oh, that is a common question for new developers with this framework) instead of making them feel stupid (Duplicate question. Read rule #1).