Article Alessandra Carena · Feb 4 7m read

Introduction

A REST API (Representational State Transfer) is an interface that allows different applications to communicate with each other through the HTTP protocol, using standard operations such as GET, POST, PUT, and DELETE. REST APIs are widely used in software development to expose services accessible by other applications, enabling integration between different systems.

However, to ensure that APIs are easy to understand and use, good documentation is essential. This is where OpenAPI comes in.

0
0 0
Question Alessandra Carena · Jan 30

I am building a web application that uses JWT for authentication. I would like to pass the token in cookies instead of the Authorization header.
Is there a way to intercept the request and check the token from the cookies instead of the header? I tried overriding the OnPreDispatch() method and adding it to my dispatch class, but it seems like it never gets executed, as the response returns "Unauthorized" before reaching it.

0
0 0
Question Alessandra Carena · Oct 10, 2024

Hello everyone,

I'm working with a class generated by OpenAPI in InterSystems IRIS, specifically impl.cls. In one of the classmethods of this class, I need to switch to the %SYS namespace to access system-level functionalities and then switch back to the original namespace.

I tried using the following commands:

new $namespace
set $namespace = “%SYS”

However, these give an error when executed. Is there a proper way to change namespaces programmatically within a classmethod and gain access to the %SYS namespace? Any best practices or example code snippets would be greatly appreciated!

Thank you!

0
0 0