Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Its a Rolex
Jan 23, 2023

Hey, posting is posting. You emptyquote, I turn my monitor on; what's the difference?

bob dobbs is dead posted:

is it surprising? less than one would hope. should they be fed into a wood chipper? yes.

this is all i needed to hear. they're also mixing integers as percentages versus floats for representing ratios between 0 and 1, which i just spent three hours banging my head against the desk to figure out. neither value is inherently discrete and they can both have arbitrary precision in theory so i really don't get it.

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Its a Rolex posted:

this is all i needed to hear. they're also mixing integers as percentages versus floats for representing ratios between 0 and 1, which i just spent three hours banging my head against the desk to figure out. neither value is inherently discrete and they can both have arbitrary precision in theory so i really don't get it.

there was a guy in the grey forums recently claiming that "percentage" was a totally valid way to describe a float from 0 to 1

maybe he's one of your coworkers lol

MrMoo
Sep 14, 2000

Its a Rolex posted:

is it normal to not document an API and instead tell someone to use the inspect element tool to deduce what the JSON you POST is?

Well I've had a "professional" of multiple decades say they have never written a JSON schema in their entire career, and they write APIs every day for new customers. Not specifically the "JSON schema", as in any reasonably complete detail of JSON contents that an API produces.

Bloody
Mar 3, 2013

i would simply let swagger and swashbuckle handle it

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


MrMoo posted:

Well I've had a "professional" of multiple decades say they have never written a JSON schema in their entire career, and they write APIs every day for new customers. Not specifically the "JSON schema", as in any reasonably complete detail of JSON contents that an API produces.

I've written a bunch due to job hopping but I'm guessing some of my coworkers who've been at *bigcorp since forever have not written one either, despite writing systems software with a network API for well over a decade

the API docs are agreed upon and updated by architects, middle management and product, devs can give feedback at best

e: and even the feedback is in the form of a polite post-facto request for consideration at the next weekly API meeting

and the API is 100+ pdf pages just for our component, it's not like it's small or anything

also it's an internal API there aren't any external clients

Private Speech fucked around with this message at 04:41 on Jan 25, 2023

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Bloody posted:

i would simply let swagger and swashbuckle handle it

weird names for your interns but ok

Shaggar
Apr 26, 2006
Nap Ghost

Its a Rolex posted:

is it normal to not document an API and instead tell someone to use the inspect element tool to deduce what the JSON you POST is?

thats called REST

Shaggar
Apr 26, 2006
Nap Ghost

Its a Rolex posted:

they're also mixing integers as percentages versus floats for representing ratios between 0 and 1, which i just spent three hours banging my head against the desk to figure out. neither value is inherently discrete and they can both have arbitrary precision in theory so i really don't get it.

thats called JSON

Shaggar
Apr 26, 2006
Nap Ghost
we had service definition files that actually worked 20 years ago and we're just now getting around to swagger/openapi docs being somewhat normal, even if not always useful. i cannot believe what these web "developers" have taken from us.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

I'll take inspectable browser requests over wrong documentation any day

(but hopefully those aren't your only two options)

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.

Shaggar posted:

we had service definition files that actually worked 20 years ago and we're just now getting around to swagger/openapi docs being somewhat normal, even if not always useful. i cannot believe what these web "developers" have taken from us.

Are you talking CORBA? I'm convinced that bad firewall culture and IPv4 exhaustion has set us back about a decade, yeah.

Shaggar
Apr 26, 2006
Nap Ghost
SOAP

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
inspectable browser requests implies that you have a working example of something using the api and that's already miles ahead of plenty of things i've had to touch.

cowboy beepboop
Feb 24, 2001


Shaggar posted:

we had service definition files that actually worked 20 years ago and we're just now getting around to swagger/openapi docs being somewhat normal, even if not always useful. i cannot believe what these web "developers" have taken from us.

every swagger/openapi thing I've seen has been wrong and generated broken poo poo

Shaggar
Apr 26, 2006
Nap Ghost
yeah the only ones that work are the .net ones where its generated from your code and all the associated attributes. but even then it doesnt work if your model and service interface designs are bad.

redleader
Aug 18, 2005

Engage according to operational parameters
application piss interface

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Shaggar posted:

yeah the only ones that work are the .net ones where its generated from your code and all the associated attributes. but even then it doesnt work if your model and service interface designs are bad.

java with swagger works just fine with the annotations to build the doc as well with the same caveats you mentioned.

oddly enough soap was far easier to build clients with in java since it came packed with wsexport until java 11 removed it.

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.


my favourite service definitions are the ones that are just reams of auto generated cruft like "GET /fart => get a fart" with zero actual explanation that when you call turn out to have some internal validation that fails with an http error and no return message

distortion park
Apr 25, 2011

soap only ever worked for me if you used the same stuff to generate specs as you did clients

swagger OTOH works if you don't use any of the features the spec offers, because almost none are fully supported

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
OpenAPI specs built from code annotations usually miss 90% of the possible return codes, usually miss any examples and are generally there to tick the "we have documentation box"

hand-written OpenAPI specs OTOH don't exist, because the spec is terrible to write manually

all this because webdevs at some point decided that xml wasn't good, it only took them all this time to realize why they were wrong

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



everything is bad!!! loving piece of poo poo :argh:

PokeJoe
Aug 24, 2004

hail cgatan


Carthag Tuek posted:

everything is bad!!! loving piece of poo poo :argh:

PokeJoe
Aug 24, 2004

hail cgatan


xml is.......fine

PokeJoe
Aug 24, 2004

hail cgatan


Are you guys talking about java? It's good :coffee:

PokeJoe
Aug 24, 2004

hail cgatan


Java is named after coffee because both java and coffee are good and they power your daily life

PokeJoe
Aug 24, 2004

hail cgatan


PokeJoe easily claimes the pentuple

cinci zoo sniper
Mar 14, 2013




PokeJoe posted:

PokeJoe easily claimes the pentuple

7/10 no ring

distortion park
Apr 25, 2011

Sagacity posted:

OpenAPI specs built from code annotations usually miss 90% of the possible return codes, usually miss any examples and are generally there to tick the "we have documentation box"

hand-written OpenAPI specs OTOH don't exist, because the spec is terrible to write manually

all this because webdevs at some point decided that xml wasn't good, it only took them all this time to realize why they were wrong

i handwrote them for a project once, the problems were:
* you had to be careful what features you used, as none of the client generation libs support the same subset
* you then have to generate the server controllers (diy, couldn't find anything that did this already) or set up something that ensures your server is in line with the specs (possible without much effort to add to your testing suite but you'll have to work out how)

distortion park
Apr 25, 2011

comedy option would be to handwrite the specs but not test them, guaranteeing that your specs always differ from the actual behaviour

Sapozhnik
Jan 2, 2005

Nap Ghost
openapi-typescript can codegen types from a hand-written openapi spec, seems pretty nice to me from the little bit i've played with it. you can also import the jsonized form of your openapi spec as a runtime constant and feed the request payload bits into a json schema validator for request validation.

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.


quote:

catch(SqlException sex)
{

}

hehehe

visual studio linter posted:

the variable "sex" is declared but never used

:(

MrQueasy
Nov 15, 2005

Probiot-ICK

visual studio linter posted:

the variable "sex" is declared but never used

don’t worry, the op wouldn’t have known what to do if it was

Shaggar
Apr 26, 2006
Nap Ghost

poemdexter posted:

java with swagger works just fine with the annotations to build the doc as well with the same caveats you mentioned.

oddly enough soap was far easier to build clients with in java since it came packed with wsexport until java 11 removed it.

c# attributes are the same thing as java annotations in this context. but of course soap worked far easier cause it was designed so you could always generate a viable client, but swagger generated clients are not always viable cause complex models and return types may not be fully documented or easy do deserialize

Shaggar
Apr 26, 2006
Nap Ghost
This is the world REST users want:

animist
Aug 28, 2018

help

VikingofRock posted:

lol if you're not writing a full gr-based n-body simulation to determine the precise moment of the equinoxes and solstices in the greenwich mean reference frame. just lol

any REAL datetime library needs accelerometer access so it can compute boosts

cinci zoo sniper
Mar 14, 2013




Shaggar posted:

This is the world REST users want:



actually it's this https://github.com/clouddrove/terraform-aws-api-gateway/blob/master/main.tf

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Shaggar posted:

This is the world REST users want:



they have played us for absolute fools

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Shaggar posted:

This is the world REST users want:


On every single API method, too :discourse:

Shaggar
Apr 26, 2006
Nap Ghost
yeah trying to treat http as anything other than a dumb transport has been a failure

Adbot
ADBOT LOVES YOU

12 rats tied together
Sep 7, 2006

Shaggar posted:

This is the world REST users want:



lmfao @ reproducing the http specification as method attributes. where are the listings for the other 85 types of http response? its impossible to handle a request unless we list themall

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply