MatrixAI / Architect

Programming Language for Type Safe Composition of Distributed Infrastructure
Apache License 2.0
1 stars 0 forks source link

Open World Assumption vs Closed World Assumption (discussion from OpenAPI) #25

Open CMCDragonkai opened 5 years ago

CMCDragonkai commented 5 years ago

Take a look at this: http://docs.http-prompt.com/en/latest/user-guide.html#ls-cd-and-openapi-swagger-specification

It's an interactive HTTP client that when given an OpenAPI spec it can understand an HTTP API and interactively explore it.

This raises an interesting issue. Is OpenAPI related to HATEOAS?

There's 2 discussions about this:

This blog post captures some of the essential problem between OWA and CWA: https://nordicapis.com/evolution-openapi-specification-openapi-mean-open-world/

I'm wondering if this has some relationship to type systems. Specifically about polymorphism. Types appears to bound the external behaviour of a data structure or functions. But allows levels of genericity to occur. How does this relate to the issue of API types that we are trying to implement in our Architect language and protocol specification?

CMCDragonkai commented 5 years ago

I just realised that mediatypes has parameters. For example these are valid mediatypes of CSV:

text/csv;charset=utf8
text/csv;charset=utf8;header=absent
text/csv;charset=utf8;header=present

The concept of a mediatype is just like a tag for a type. However this concerns the Unique Name Assumption: https://en.wikipedia.org/wiki/Unique_name_assumption

We expect everything understanding these tags has the same understanding. This is only true in a type safe environment that can check the "construction" of these tags. Without so, there's no way to be guaranteed that the same name/tag means the same thing.

It may be interesting to extend this idea to working on RDFs: http://hackage.haskell.org/package/swish