Summary: code snippets and explanation of how to validate HTTP-response using openapi-core package If you deal with some service based on OpenAPI Specification you might want to perform validation of HTTP responses returned by it. One of the ways to do this an internet search provides for Python is to use openapi-core package. If you look at their documentation ( here or here ) you will find it very stingy: couple of short code snippets and couple of sentences just stating what is done. In particular for response validation we have exactly the following: You can also validate against responses from openapi_core . validation . response . validators import ResponseValidator validator = ResponseValidator (spec) result = validator . validate (request, response) # raise errors if response invalid result .raise_for_errors() # get list of errors errors = result .errors ... Here we see some confusing things: why do we need a request object to be able to validate the respo
Forth is an example of what I call “ elegant solution of a complicated problem”. What will you do if you have a computer without any software to operate on it? It’s hard to imagine an alternative to what Charles H. Moore invented in 1970. Indeed, if you don’t have an operational environment to accomplish your goal you have to create that environment from zero. The question is only of ‘cost’ — efforts you will spend. The geniousness of the Forth language is that it is designed so that it can be easily implemented step by step from scratch and on each next step existing part of the system helps you a lot to move further. _________ ..other articles..
Working on his theory of inventions Genrich Altshuller invented/discovered so called Laws of technical systems evolution which further were developed by other contributors. Looking at those laws we can see that all of them are in some sense “positive” — i.e. implicitly assume that technical systems always develop from “worse” to “better” only. BUT from my experience I can conclude that the things are not so simple. For example: in 2000ths I used several button-based “stupidphones”. They could do almost nothing except the very basic functions a phone in general is necessary for. And of course it was very unsatisfactory. But when I changed to use “smartphones” I soon was faced with very disappointing obstacle: when I set an alarm on a “stupidphone” and it happens that the device is low on power it still is able to awake next day to activate the alarm and perform ringing even if it turned off due to a complete discharge of the battery before. Very helpful feature. And no modern devi
Comments
Post a Comment